The African Union and western diplomats have agreed to send a team to Somalia to assess the possibility of deploying peacekeepers there.
The militia and interim government hope to hold negotiations
The assessment team will decide how many troops would be needed.
The Islamists, who control the capital Mogadishu, fiercely oppose the idea and last week held large protests.
Tension is high in Somalia, after the Islamists said Ethiopian troops had crossed the border - a claim the Ethiopians have denied.
Somalia has had no effective national government for 15 years.
Ethiopia is seen as being close to President Abdullahi Yusuf and there are some unconfirmed reports that Ethiopian troops have been spotted in Baidoa, the town 200km north of Mogadishu, where his government is based.
"We call on the international community to pressure Ethiopia [to] remove its troops from Somalia territory in order to avoid another conflict," said Sheikh Ali Hassan, an official in the Union of Islamic Courts, reports the AFP news agency.
Islamist militias have been moving towards the Ethiopian border.
After a meeting in the Ethiopian capital, Addis Ababa, AU Peace and Security Commissioner Said Djinnit told reporters that there was unanimity among the international community to support the interim government, which has requested peacekeepers.
He said the situation was extremely serious and could threaten regional stability but there was a "window of opportunity".
He said they were calling for dialogue between all of the parties in Somalia.
Before any peacekeepers were deployed, the UN would have to lift its arms embargo on Somalia.
Tim Clark, head of the European Union delegation to the talks said there was a real sense of urgency.
"The situation could unravel very, very fast unless there is a real muscular response," he said.
The BBC's Hassan Barise in Mogadishu says Somalis fear that any foreign peacekeepers brought into the country would end up clashing with the Islamist militias.
Correspondents say the only place safe enough for peacekeepers would be Baidoa, but many residents in Baidoa fear an assault from the Islamic courts militia.
The government initially welcomed the Islamists' victory against warlords but the peacekeeper issue has divided them.
President Yusuf has set three conditions for talks:
- The Islamic courts leave other towns they have seized and withdraw to Mogadishu
- They recognise his government
- They lay down their weapons
In return, the Islamists refuse to have talks until the government says it does not want foreign peacekeepers.
On Sunday, UK Minister for Africa Lord Triesman called on the government and the Islamic courts to begin a dialogue to try to bring order to the country.
He told the BBC's Newshour programme that he had spoken to President Abdullahi Yusuf and had called on him not to invite Ethiopian forces into the country.
Ethiopia has been mentioned as one of the countries that could send peacekeepers to Somalia, but Ethiopia is deeply distrusted by some Somalis.
During the 1990s, Ethiopia helped Mr Yusuf expel an Islamic group from the northern Puntland region he controlled.
Intense diplomatic pressure is being applied by the international community to try to stop Somalia, which has had no effective government for 15 years, from spiralling further into civil war.
On Sunday, United Nations High Commissioner for Refugees Antonio Guterres told the BBC that there could be a really catastrophic humanitarian situation if there was major confrontation in Somalia.