Somalia's exiled parliament has voted in favour of two measures strongly opposed by key warlords, leading to a deep rift in the interim government.
Militiamen in Mogadishu will be retrained as a security force, the warlords say
Those MPs present supported calls for a regional peacekeeping force and to relocate to two Somali towns, but not the lawless capital, Mogadishu.
The vote was boycotted by MPs loyal to the Mogadishu-based warlords, who this week said their forces would unite.
Somalia has been wracked by violence and anarchy for 14 years.
The BBC's Caroline Karobia in the Kenyan capital, Nairobi, where Somalia's parliament is based, said the MPs erupted in jubilation when the results of the vote were announced.
Of the 152 MPs present, 145 voted in favour of setting up in Baidoa and Jowhar until Mogadishu is considered safe. There were seven abstentions.
A similar vote in March was declared null and void after MPs fought in parliament - but parliamentary speaker Sherif Hassan has said this vote was also unconstitutional because he did not call the meeting.
More than 100 members of the 275-strong parliament are in Somalia, including the warlords who control the capital, and have refused calls to return to Kenya.
In Washington, the US and the European Union released a joint statement voicing their concern at the lack of progress.
"The Somali reconciliation process is at a critical stage. There is an urgent need for a viable agreement on relocation and security," it said.
Foreign donors, who have bankrolled the long peace talks, are pressing the transitional government to relocate to Somalia.
The African Union is to meet on Thursday to consider the foreign troop deployment.
The session will examine a proposal to send 1,700 Sudanese and Ugandan troops to ensure the security of President Abdullahi Yusuf Ahmed.
But the issue of foreign troops is controversial.
President Yusuf is seen as an ally of Ethiopia but he has little support in Mogadishu.
Many Somalis do not trust Ethiopia, since a war in the 1970s.
The Mogadishu warlords accused Ethiopia of sending weapons into Somalia - a charge Ethiopia denied.
Since his election last October, he has called for an African Union protection force before he can lead his government back to Mogadishu.
The regional body, Igad, has agreed to send troops but a lack of finance and security fears have led to delays.
Mogadishu warlords Mohammed Qanyare Affra, Osman Ali Atto and Muse Sudi Yalahow, who have spent years fighting each, said that they would this week start withdrawing their forces from the capital and setting up a single militia force.
They say this will restore security in Mogadishu but some government officials fear that the force could be used against them, if relations continue to deteriorate.