Budapest--Hungary said Wednesday it was building a barrier on its border with Serbia to keep out migrants, as the EU struggles to deal with the massive flow of people trying to reach Europe.
The move was announced as Pope Francis hit out at nations that "close the door" to those seeking a safe haven from war, poverty and persecution.
And France said it was "doing its part" by creating 10,500 new housing units for asylum seekers and immigrants.
In Budapest, Foreign Minister Peter Szijjarto said Hungary's government has ordered work to start on a four-metre (13-foot) high fence along the length of its 175-kilometre (110-mile) border with Serbia.
"This decision does not break any international treaty, other countries have opted for the same solution," he said, citing similar barriers on the Greek-Turkish and Bulgarian-Turkish frontiers and around Spanish exclaves in Morocco.
Serbia is not part of the European Union, while EU member Hungary is in the passport-free Schengen zone. Once inside Hungary, migrants can therefore travel easily elsewhere in the 26-nation zone.
Hungary says around 95 percent of the tens of thousands of migrants to have entered the country so far this year came through Serbia.
Last year, Hungary received more refugees per capita than any other EU country apart from Sweden.
And Prime Minister Viktor Orban has sparked accusations of xenophobia over anti-immigration comments and a poster campaign with slogans such as "If you come to Hungary, you cannot take Hungarians' jobs."
Serbia's Interior Minister Nebojsa Stefanovic called on neighbouring Bulgaria and Greece -- both EU members -- to "make more of an effort" to stop migrants entering the former Yugoslav republic.
AFP