The four-point agreement, reached after three days of Arab League-mediated talks in the Sudanese capital, commits to the two sides to respecting a previous mutual recognition and truce pact and bars them from seeking military aid from neighbouring states.
They also agreed to begin talks on power sharing on October 30, at the end of the Muslim holy month of Ramadan, to cement the principles of the deal intended to prevent the lawless nation from plunging into further chaos.
However, the deal did not address the thorny issue of the deployment of regional peacekeepers in support of the internationally backed but ineffective government that the Islamists fiercely oppose and have threatened to resist.
Nonetheless, officials from the two sides and mediators hailed what they said was an "historic" agreement to ease rising tensions and restore stability to Somalia, which has been in the throes of anarchy for the past 16 years.
"I am delighted by the signing of this agreement that will pave the way for the pacification of Somalia," said Ibrahim Hassan Addow, the chief of the Islamist delegation.
"As the Islamic courts, we will implement this agreement that has been made here in Khartoum and we call upon the government to do the same," he said at a ceremony witnessed by Sudan Foreign Minister Lam Akol and Arab League representative Abdul Halima.
Somali's deputy prime minister, Abdullahi Sheikh Ismail, who signed on behalf of the government, the limited authority of which has been severely challenged by the Islamists, echoed those sentiments.
"The Somali people are tired of war," he said. "They no longer want to see a continuation of factional fighting. The time to make peace has come and we will not hesitate to take all opportunities to ensure our country is peaceful."
The accord's main point says the two sides have agreed on "the formation of a Somali national army and police force by integrating the forces of Islamic militia, the transitional federal government and other local militia."
In addition, it sets out three points to which the sides will adhere, including continued implementation of June 22 accords that they have each accused the other of violating.
Those charges stem from the alleged presence in Somalia of troops from neighbouring Ethiopia and its arch-foe Eritrea; Addis Ababa in support of the government and Asmara backing the Islamists.
All of the accused have denied the allegations.
The interim deal says the Islamists and the government will "co-exist peacefully with neighbouring countries and ask regional states to respect the territorial integrity of Somalia."
It also says the two sides will not "support Somali warlords (or) fight among themselves or re-arm themselves."
But it does not mention at all the government's repeated requests for east African peacekeepers to shore up its limited authority, an issue to be raised at a summit of regional leaders in Kenya on Tuesday.
In a position paper presented earlier Monday in Khartoum, and in talks with
Kenyan officials in Nairobi, the Islamists had renewed their absolute rejection of any foreign forces on Somali soil.
"We discussed this issue, but we reached no agreement whatsoever," said
Sheikh Sharif Sheikh Ahmed, the head of the executive committee of the Supreme Islamic Council of Somalia (SICS).
"We warned them that any deployment against our wishes will spoil everything, including the small peace in the country," he told reporters after returning to Mogadishu from the Kenyan capital on the eve of the summit.
Somalia has been without a functioning central authority since the ouster of strongman Mohamed Siad Barre in 1991. The rise of the Islamists, who seized Mogadishu in June, poses a serious challenge to the transitional government.
The Islamists have moved to fill the power vacuum and since taking the capital have expanded their control over much of southern Somalia, fuelling fears of a Taliban-style takeover by imposing strict Sharia law.
Meanwhile the transitional government, the latest in a series of more than a dozen international attempts to restore stability to the Horn of Africa nation, has been riddled with infighting and unable to assert authority.
