BUDAPEST (Reuters) - Hungary passed a law on Monday that allows police to send back illegal migrants detained within eight kilometres (five miles) of its southern frontier to the Serbian side of the border fence, drawing criticism from the U.N. refugee agency.

Migrants rest as a policeman watches them near Hungary's border fence on the Serbian side of the border near Morahalom, Hungary, February 22, 2016. REUTERS/Laszlo Balogh

A razor-wire fence built along Hungary’s southern border with Serbia and Croatia has helped to reduce sharply the flow of migrants from the hundreds of thousands who last year moved up from the Balkans towards northern Europe, especially Germany.

However, a steady trickle of migrants is still arriving at Hungary’s border with Serbia. Budapest has set up two transit zones there where migrants can submit a request for asylum.

“The aim ... is to allow (the authorities) to escort back across the gates of the border defence facility third-country nationals who are in Hungary illegally and who were detained within eight km of the border,” the reasoning of the law said.

Serbian officials were not immediately available to comment.

So far this year Hungary has registered 19,140 asylum applications and more than 14,000 migrants have crossed its southern borders illegally, according to government data.

Hungary has recently limited the number of daily admissions into the transit zone to a maximum of 30, government spokesman Zoltan Kovacs said last week. Kovacs added that Hungary was following European and international law as well as Hungarian protocols for admission.

That narrow bottleneck has caused migrants to amass in makeshift camps near the transit zones. The camps are still on Hungarian territory but on the southern side of the fence.

The U.N. refugee agency said the new law approved by Hungary’s parliament would only exacerbate the situation of those waiting to be able to submit an asylum application.

Erno Simon, a UNHCR spokesman in Budapest, said it would force migrants to wait outside the transit zones and could prompt many to turn to human traffickers.

“Obviously, this will only exacerbate the inhumane conditions at the two transit zones,” Simon said.

Another rights group, the Hungarian Helsinki Committee, accused the government of wanting to keep the number of migrants as low as possible.

Helsinki Committee co-chair Marta Pardavi said that, based on the new legislation, police would escort migrants back to the other side of the fence to the transit zones where they would have to queue without basic amenities. This way migrants would basically be “booted out” of the country, she said.

“Instead of providing proper treatment and procedures prescribed by law, the aim is to have ... no asylum seekers arriving in Hungary,” Pardavi added.