US naval forces have deployed off the Somali coast to prevent leaders of defeated Islamist militias escaping.
Kenya has also significantly tightened border security to stop an influx of fleeing fighters, as aid agencies called for help for genuine refugees.
A two-week advance by Ethiopian troops swept the Islamist militias from areas they had controlled for six months.
The militias - known as the Union of Islamic Courts - had brought a degree of stability to large areas of the formerly lawless country.
But
Islamists say their retreat from the troops is tactical and have threatened to launch an insurgency.
'Security vetting'
US State Department spokesman Sean McCormack confirmed the deployment of navy ships.
"We would be concerned that no leaders who were members of the Islamic Courts which have ties to terrorist organizations including al-Qaeda are allowed to flee and leave
Foreign Minister Raphael Tuju told a news conference that the border was closed, but government spokesman Alfred Mutua later told the BBC that legitimate refugees were being allowed entry.
"We are conducting very thorough and rigorous security vetting to ensure that we don't get people coming in carrying weapons, people coming in who are Islamists," he said.
"And so that is causing delays, but we are making sure that everyone who comes in as a refugee... we are driving them to a camp within
Mr Mutua denied reports that 600 Somali refugees, mainly women and children, had been deported from the border transit camp at Liboi.
A spokeswoman for the UN refugee agency UNHCR said they had been denied access to the camp by Kenyan authorities, but witnesses had reported Somalis being deported in government trucks.
UNHCR head Antonio Guterres said in a statement that deserving Somali civilians should be entitled to seek asylum in
'Inclusive political process'
On Wednesday, Ethiopian and Somali government forces captured the border town of
Between 600 and 700 militia fighters fled the town on Tuesday night, a BBC correspondent said.
Somali Prime Minister Ali Mohamed Ghedi has said that he believes the bulk of the fighting is over.
Attention is now focusing on how to stabilize the country.
After European members of the Somali Contact group met in
"There has to be a withdrawal of the Ethiopian forces. There has to be a political process, an inclusive political process in
Ugandan President Yoweri Museveni is due in
Thursday is also the deadline for Somalis in the capital to hand in their weapons, but slow progress has been made so far.
Photo caption
Ethiopian soldier in the streets of