The world’s leading refugee agencies and human rights groups have condemned it. But Hungary’s government is determined to start keeping asylum-seekers in detention in metal shipping containers.

Fending off what the government calls an “invasion,” the authorities will take all asylum-seekers apprehended throughout Hungary to camps surrounded by barbed wire on the southern border. The migrants are to wait there while their asylum claim is reviewed — which can take many months.

The measure applies to men, women and children over 14.

Cécile Pouilly, spokeswoman for the UN refugee agency UNHCR, said the move “will have a terrible physical and psychological impact on women, children and men who have already greatly suffered.”

Approved by parliament on March 7, this is the latest anti-migrant measure to come from the government of Prime Minister Viktor Orban. He’s a proponent of “illiberal democracy.” He’s also one of Europe’s only leaders to endorse US President Donald Trump during his campaign for the White House. Other tactics include “smart fences” and “border hunters.”

Hungarian Prime Minister Viktor Orban attends a swearing-in ceremony of border hunter recruits in Budapest, Hungary, on March 7. Credit: Laszlo Balogh/Reuters

"Migration is the Trojan wooden horse of terrorism," Hungary’s prime minister said recently. "The people that come to us don't want to live according to our culture and customs but according to their own — at European standards of living."

Those remarks came during a swearing-in ceremony for so-called border hunters — civilians who receive six months training before being issued a pistol, batons, handcuffs and pepper spray to patrol Hungary’s borders looking for refugees.

Hungary, a European Union member, has defied EU rules on processing and resettling the record numbers of asylum-seekers who since 2015 have fled to Europe escaping war and poverty.

Hungary shares its southern border with Serbia and Croatia — marking the frontier of the EU’s free travel zone across 26 countries known the Schengen area, so it’s been a key migrant crossing point. The country sits right in the middle of the migrants’ Balkan route, leading from Turkey to northern Europe, through which more than a million people fled in 2015, primarily from Syria, Iraq and Afghanistan.

Related: Europe's Schengen Agreement allows free movement among 26 countries. Will it last?

The Hungarian authorities responded to the exodus by constructing razor-wire fences along the country’s southern perimeter. In September 2015, police deployed tear gas and water cannons on refugees, including many children, protesting European border closures.

Last October, the Hungarian government called a referendum on whether to take part in the EU’s refugee resettlement program. The vote was widely deemed a failure after barely 40 percent of voters bothered to cast a ballot.

The government stresses that the refugees’ incarceration can be ended if they agree to be sent back to neighboring Serbia, from where almost all enter.

“Mass automatic detention without judicial control is against EU law and the Hungarian constitution,” Marta Pardavi, with human rights watchdog Hungarian Helsinki Committee, told us. “The European Commission should start infringement proceedings against Hungary immediately.”

Serbia, an EU candidate, currently hosts more than 7,000 marooned asylum-seekers. Those who are spirited up the Balkans by international smuggling gangs can’t get across the border to Hungary because of its tough entry restrictions. Hungary currently maintains a policy to allow in just 10 asylum-seekers per weekday. Who can enter is decided by a largely arbitrary list managed by refugees themselves and is open to bribery.

Related: Refugees are still squeezing through Europe's clamped borders

Saboor Abdul, 25, who fled Afghanistan after his work with the US Army made him a target of the Taliban, has been stranded in the Serbian capital of Belgrade for over half a year, after a series of unsuccessful attempts to continue his journey to northern Europe.

An Afghan asylum-seeker provided images of what he said were injuries other migrants sustained from Hungarian authorities. Credit: Courtesy of Saboor Abdul

“They beat us, stole our clothes and broke people’s arms. And the dogs … I saw them set three dogs on one man. A lot of people lost their mind here. But we will continue to try, and hope, what else can we do?” he said.

Abdul remembers more positive interactions with the Hungarian military when he worked for them as a crane operator and supervisor in Afghanistan during their NATO deployment.

“In Afghanistan they were nice people, I don’t know what happened to make them like this now in their own country!”

Doctors Without Borders working in Serbia has documented and decried a staggering amount of migrants with injuries allegedly caused intentionally by Hungarian border guards, claims that are entirely dismissed by the Hungarian government.

Due to the border officials apparent practice of confiscating and destroying refugees’ phones, direct evidence is difficult to obtain. But Abdul provided PRI with photos of what refugees report are their wounds inflicted by Hungarian authorities on the border of the EU.

Prime Minister Orban has kept immigration constantly on the top of the political agenda, despite a huge drop in numbers of refugees reaching Europe since the peak of 2015. Last year, Hungary (population 10 million) granted asylum to 425 people, according to the Hungarian Helsinki Committee. It’s not known if all of them have remained in the country.

Speaking in London in February, his chief spokesman Zoltan Kovacs remarked that Trump’s election had prompted a “change of mood in Europe” and served to vindicate Hungary’s draconian stance toward immigration.

“A change of perspective in the US helped others to respect the Hungarian position,” Kovacs said.

Sixty years ago, hundreds of thousands of Hungarians fled on foot into neighboring countries after a popular uprising against the Soviet-aligned regime was lethally suppressed with tanks and snipers. The mass displacement of Hungarians presented a huge challenge to international humanitarian organizations and the ensuing relief operation largely helped shape future responses to similar refugee crises around the world.