Serbia and Macedonia, which lie on the main migrant route to northern Europe, have begun restricting the entry of asylum seekers to just those from certain countries, the UN refugee agency says.

"Since yesterday afternoon Serbian authorities allow into the country only refugees from Afghanistan, Syria and Iraq," when they have documents to prove it, UNHCR spokeswoman Melita Sunjic said.

"They turn back all the others to Macedonia."

Ms Sunjic said Macedonia was also barring asylum seekers from certain countries including Liberia, Morocco, Pakistan, Sri Lanka and Sudan.

Jasmin Redzepi, president of Macedonian NGO LEGIS whose activists have been helping refugees and migrants at the border with Greece, said that Macedonia was also allowing only Iraqis, Afghans and Syrians into the country.

An AFP photographer at the Macedonia-Greece border said that about 200 to 300 asylum seekers were waiting in a "no man's land" as police guarded the border, but he said they were not trying to cross.

Meanwhile, nearby Croatia has refused a request from Slovenia to take back migrants who had crossed the countries' shared border, a police spokesman said.

"Slovenia asked us for the re-admission of 162 people. We did not accept that and have informed our neighbours about everything," Croatian police spokesman Domagoj Dzigumovic said.

The request, made late Wednesday, referred to nationals of countries that were not affected by war, Mr Dzigumovic said, adding that the 162 migrants were still in Slovenia.

Earlier a police spokesman in Slovenia confirmed Ljubljana would start returning "economic migrants" arriving through neighbouring Croatia, saying it could only grant passage to those "from countries where there are armed battles".

Hundreds of thousands of asylum seekers fleeing war and poverty have crossed the Mediterranean from Turkey to Greece.

Those who survive the sea journey travel overland through Macedonia and then Serbia to reach EU countries.

Calls by some right-wing European politicians to stop the influx have been fuelled by indications that one of the perpetrators of the November 13 attacks in Paris by Islamist militants, in which 129 people died, reached Europe by infiltrating the chaotic and often unchecked flow of asylum seekers.

AFP/Reuters