Some of the warlords who have fought in Somalia for 16 years have said they will surrender their weapons - after a battle, which left at least five dead.
The gunmen have returned to Mogadishu's streets
The warlords agreed to lay down their guns after meeting President Abdullahi Yusuf in the capital, Mogadishu.
As the talks were being held, gunmen loyal to one of the warlords battled presidential guards outside.
The warlords and the president returned to Mogadishu this week, after the ousting of an Islamist group.
Meanwhile, aid agency Oxfam says that at least 70 people were killed in this week's air strikes against Islamists and suspected al-Qaeda operatives.
"The warlords and the government have agreed to collaborate for the restoration of peace in Somalia," said government spokesman Abdirahman Dinari following the talks in Somalia's presidential palace.
"The agreement means they have to disarm their militia and their men have to join the national army," he said.
He named the warlords who had agreed to disarm as:
- Mohamed Qanyare Afrah
- Musa Sudi Yalahwo
- Omar Mohamed Mohamoud
- Issa Batan Alin
- Abdi Hassan Awale Qeiybdid
- Omar Habeb
- Bashir Raghe Shirar.
They formed a US-backed alliance last year but were driven out of Mogadishu by the Islamists.
The gun battle, in which a rocket-propelled grenade was used, was reportedly sparked by a dispute over where to park an armoured vehicle.
"They killed five of our fighters on the spot and wounded seven others, some of them seriously," said a gunman loyal to Mr Qanyare.
"They refused to allow our wounded to be taken to hospitals."
Such clashes between gunmen loyal to rival warlords were fairly common during 15 years of lawlessness in Somalia.
After seizing Mogadishu from the warlords last June, the Union of Islamic Courts removed most of the militias from the streets and many residents welcomed an increase in their security.
Government and Ethiopian forces routed the Islamists in recent weeks.
The Islamists denied accusations that they were sheltering senior al-Qaeda operatives, accused of carrying out attacks in East Africa.
Air strikes condemned
Oxfam says it is deeply concerned that civilians and military targets were not distinguished in this week's air strikes, leading to innocent deaths.
"According to the reports from local organisations in Afmadow district, bombs have hit vital water sources as well as large groups of nomads and their animals who had gathered round large fires at night to ward off mosquitoes," Oxfam said.
The warlords and the president (r) went back to Mogadishu this week
Earlier, Djibouti, which hosts a large United States anti-terror base, condemned this week's US air strikes in southern Somalia.
Eritrea's President Isaias Afeworki, accused of backing Somalia's Islamists, has also condemned the air strikes, saying they could destabilise the region.
The US says it was targeting al-Qaeda operatives.
Somali's interim government has backed the air strikes, in which a US official says that Somalis linked to al-Qaeda were killed.
But he said the top three suspects in those attacks - Comoros national Fazul Abdullah Mohammed, Kenyan Saleh Ali Saleh Nabhan and Abu Taha al-Sudani of Sudan - all survived.
Aid workers report that more 1,000 people have been wounded since fighting erupted in December.
However, there is no reliable information on casualties in the current fighting in the remote south.