Islamic leaders who have seized Somalia's capital after weeks of fighting are beginning talks with the UN-backed government, while the defeated regional commanders are advancing back towards Mogadishu from their stronghold of Jowhar.
The Islamic militia captured the capital and surrounding areas after defeating a US-backed alliance of regional commanders, tightening its grip on Somalia.
The weak interim government, wracked by infighting, has not been able to enter the capital because of the violence, instead operating 250km away, in Baidoa.
Abdirahman Nur Mohamed Dinari, the government spokesman, said two ministers from the interim government were meeting top leaders of the Islamic Courts Union on Thursday.
The growing power of the Islamic militia, which has alleged links to al-Qaeda, has raised fears that Somalia - which has been in chaos for more than a decade - could fall under the sway of Osama bin Laden's group.
US officials have confirmed co-operating with the secular regional commanders in an attempt to root out "terrorists".
In a letter to the United States and other governments, the chairman of the Islamic Courts Union said the US bore some blame for the fighting.
The battle for Mogadishu killed at least 330 people, many of them civilians caught in the crossfire.
According to the letter, which was signed by Sheikh Sharif Ahmed, "the alleged support of the US government to these warlords has contributed considerably to the recent fighting in Mogadishu and the killing of the Somali people who have suffered so long in the hands of these warlords".
Somalia has been without a government since largely clan-based regional commanders overthrew Mohamed Siad Barre, the president, in 1991 and then turned on each other, dividing the nation of 8 million into a patchwork of rival fiefdoms.
On Wednesday, the remnants of the secular alliance tried to regroup as the Islamic militia rolled through its newly captured territory.
Militiamen toting heavy machine guns installed an Islamic court in Balad, about 30km from the capital. Residents said an Islamic state would help pacify the nation.
The capital's residents said the regional commanders had moved into the positions south of Jowhar, previously occupied by Islamic militias loyal to Mogadishu sharia courts.
"The coalition has moved forward to Qalimoy, where the Islamic courts militia were yesterday, while the Islamic militia have moved back and are now in Gololey, which is 20km from Balad," said Abdi Warsame, a farmer.
"I think they moved back because their leaders are busy meeting in Mogadishu and they want to tighten their defences there."
The commanders have pledged to win back the capital.
Washington, which has shied away from direct involvement in Somalia since a humiliating 1994 exit of US and UN troops, has refused to discuss reports that it is funnelling $100,000 a month to regional commanders, but says it will support anyone fighting terrorism.