An Islamist militia says it has seized
The warlords have controlled the capital since they toppled
Talks are taking place with fighters still loyal to the warlords, Union of Islamic Courts officials said.
Interim Prime Minister Ali Mohammed Ghedi says his government wants to begin dialogue with the group.
Earlier, Mr Ghedi sacked four powerful Mogadishu-based warlords who had been serving as ministers.
Nine of the 11 Mogadishu-based warlords have now left the city.
The four sacked ministers include Security Minister Mohammed Qanyare Afrah and Trade Minister Muse Sudi Yalahow who over the weekend lost control of their
Most of Mr Qanyare Afrah's fighters have joined the Islamic militia, but Mr Sudi Yalahow and his commanders remain in the capital and are locked in talks over their next move.
This year's clashes in the capital have been the most serious for more than a decade, with some 330 people killed and about 1,500 injured in the past month.
Warlords retreat
In a statement read over local radio stations, the Union of Islamic Courts leader Sheikh Sharif Sheikh Ahmad said the control of
"The Union of Islamic Courts are not interested in a continuation of hostilities and will fully implement peace and security after the change has been made by the victory of the people with the support of Allah," he said.
"This is a new era for
"They said they would work with residents to improve security in the capital," city resident Ali Abdikadir told Reuters news agency.
"This is good news for us because the warlords were always engaged in battles. We are looking forward to a life without fighting."
Sharia law concerns
But some seemed unconvinced that the weeks of bloodshed were really over.
"It's good to see conflict resolved but I don't want to celebrate a temporary victory," housewife Hawa Ismail Qorey told AFP. "
And others expressed concern about what the future might hold with Islamists who want to introduce Sharia law in control.
"What I am afraid of is if they interfere with the education system and bring religion by force to the schools," Asha Idris, a mother of five, told AFP.
On Saturday, UN aid workers pulled out of Jowhar, some 90km (56 miles) north of
The violence began earlier this year when warlords who had divided
The Islamic Courts deny this. They were originally set up in
The head of the BBC's Somali service described the rise of the Islamic Courts as a popular uprising.
The Islamic Courts have long said the warlords in the Anti-Terror Alliance were being backed by the
President Abdullahi Yusuf had urged the
Islamic Court Militia