Swedish authorities have ruled that failed asylum seekers from the Somali capital, Mogadishu, can be sent back as there is no "armed conflict" there.
The UN estimates one million Somalians have fled their homes
The Swedish immigration agency said that Swedish law says there is no armed conflict in Mogadishu because rebels there do not control territory.
Ethiopian troops backing the interim government have been battling Islamist insurgents in Mogadishu.
A Somali official has said 80% of the country is not in government hands.
One million homeless
Sweden automatically grants asylum to anyone from an area in which something "more like your traditional civil war" exists, where "rebellion forces have territorial control in a part of the city, the country or the region," senior immigration official Dan Eliasson told AFP news agency.
"This is not the case in Mogadishu," said Mr Eliasson, the general director of the Swedish Migration Board.
Fighting between Ethiopian forces backing the interim government and Islamist insurgents has killed many hundreds of people, although no exact figure is available.
Bakara market was full of shoppers when the mortars landed
At least 17 people were killed in a mortar attack on Mogadishu's main market on Thursday.
The UN says one million people are living rough in Somalia - including 60% of Mogadishu's population.
About 200,000 people have fled the city in the last month.
A spokesman for the Swedish Migration Board told the BBC that he accepted the UN's description of Somalia as the world's worst humanitarian disaster but that asylum seekers would have to prove they are personally threatened to be accepted by Sweden.
The ruling is likely to be challenged in the courts.