Hungary's parliament has approved a new law allowing authorities to detain all refugees in special shipping container camps on its border.
The UN says such measures violate Hungary's obligations under international and European Union laws, and will have a terrible physical and psychological effect on asylum seekers.
Refugees whose applications are not immediately approved, will not be allowed to move freely around Hungary, but will be detained in camps set up to face only the Serbian border.
Hungary's Prime Minister Viktor Orban said the new rule is needed to reduce terrorism.
"Ladies and gentlemen, the migration crisis will last until the root causes are dealt with. It will last until it is recognised everywhere that migration is the Trojan wooden horse of terrorism."
The country has already closed its borders with Serbia and Croatia.
TRT Word's Simon McGregor-Wood reports:
— TRT World (@trtworld) March 8, 2017
EU member Hungary previously systematically detained all asylum applicants, but suspended the practise in 2013 under pressure from Brussels, the UN refugee agency and the European Court of Human Rights.