Hungary's parliament yesterday approved the automatic detention of all asylum-seekers in container camps at the borders, sparking "deep concern" at the UN's refugee agency.
The legislation, approved by a large majority of lawmakers, is in response to recent terror attacks in Europe carried out by migrants, according to hardline Prime Minister Viktor Orban.
Speaking at a swearing-in of the latest contingent of some 450 new border police in Budapest yesterday, Orban called immigration "the Trojan horse of terrorism".
"If the world sees that we can defend our borders... then no one will try to come to Hungary illegally," he added.
Under the new measures, all asylum-seekers entering Hungary as well as those currently in the country will be confined in the container camps while their applications are processed.
Anyone who passed through a "safe third country" including Serbia will be rejected, and any appeals against rejections will be fast-tracked into a three-day procedure.
Migrants whose applications are rejected may have to cover the costs of their own detention.
Hungary previously systematically detained all asylum applicants but suspended the practice in 2013 under pressure from Brussels, the UN refugee agency and the European Court of Human Rights.
Meanwhile, the EU's top court yesterday ruled that states can deny short-term humanitarian visas to people trying to enter to claim asylum, in a case of a Syrian family trying to come to Belgium.
The decision by the Luxembourg-based European Court of Justice's decision was seen as a test case for EU countries facing a surge in refugees in the past two years, mainly from Syria's civil war.
In a surprise judgment, the court ruled against the family from the besieged city of Aleppo who had applied for the humanitarian visas at the Belgian embassy in the Lebanese capital Beirut last October.