An alliance of warlords and an Islamist militia have agreed a ceasefire in the Somali capital Mogadishu after more than a week of fighting.
Up to 200,000 inhabitants have been affected by the fighting
At least 150 people, mainly civilians, have died in the violence.
There were reports earlier on Sunday of sporadic gunfire, but residents in Mogadishu say the city is now calm.
The ceasefire follows calls by President Abdullahi Yusuf on ministers, many of whom are warlords, to stop leading their militias into battle.
In the town of Baidoa, 250km to the west, members of the transitional government held a session of parliament to discuss the situation.
The transitional government has not moved to Mogadishu because of security concerns and only controls a small part of the country.
On Friday the United States called for a ceasefire. Correspondents say the violence was fuelled by the belief that the US was backing the alliance of warlords.
Sheik Sharif Sheik Ahmed signed the deal on behalf of the Islamic fighters and Nuur Daqle signed for the secular Alliance for the Restoration of Peace and Counterterrorism.
SOMALIA'S THREE RIVAL GROUPS
Gets arms from: Ethiopia, Italy (Source: UN report)
Gets arms from: Eritrea (Source: UN report)
Anti-terror alliance of warlords
Believed to get support from US
"We are not only accepting the ceasefire today but we were always ready for it," said alliance spokesman Hussein Gutale Ragheh, quoted by the Associated Press news agency.
However, Reuters news agency reported that both sides had amassed fighters on roads into the capital.
There are strong suspicions the US has been secretly funding the warlords, although Washington insists it has not violated the arms embargo on Somalia, says BBC Africa analyst David Bamford.
But a top US diplomat in Africa, Jendayi Frazer, acknowledged on Friday that the White House would work with those who can help "prevent Somalia becoming a safe haven for terrorists".
The fighting began when warlords who had divided Mogadishu into fiefdoms united to tackle a growing Islamist force, our correspondent says.
This was the second round of serious fighting in Mogadishu this year. In March, clashes between the two sides killed at least 90 people.
Somalia has not had an effective national authority for 15 years since the ousting of President Siad Barre in 1991.