The United Nations has said that Hungary's actions to keep out migrants, including fast-track trials to punish those who breach its border fence, may conflict with international refugee and human rights conventions.
Prime Minister Viktor Orbán has taken several measures to protect Hungary, and the external border of Europe's Schengen Area, since migrants began pouring into Europe last year, building a heavily guarded border fence and rejecting an EU quota system to share out migrants among member states.
Despite strong criticism from EU headquarters in Brussels, the approach has gone down well in Hungary, a country with few immigrants and issues that surround their arrival.
A new report by the U.N. High Commissioner for Refugees said that legislation recently passed in Budapest has limited and deterred access to Hungary for those seeking refuge from war and persecution.
"UNHCR considers these significant aspects of Hungarian law and practice raise serious concerns regarding compatibility with international and European law, and may be at variance with the country's international and European obligations," it said, in a report published by Reuters.
By "obligations", the UNHCR was referring to protection for people fleeing the threat of war or persecution in their home countries, and prompt processing of asylum applications.
The U.N. refugee agency criticized Hungary's fence and a procedure whereby migrants arriving at the frontier must submit their asylum requests in so-called "transit zones".
"The asylum procedure and reception conditions are not in accordance with European Union and international standards, in particular concerning procedural safeguards, judicial review and freedom of movement," the report said.
Hungary also introduced legislation in September 2015 that allows courts to order the expulsion of migrants for illegally breaching the border fence.
After domino-like closures of borders across the Balkans between Greece and Hungary, the heavy northwards flow of migrants - most of them bound ultimately for western EU countries like Germany and Sweden - seen in 2015 has since subsided.
But Hungarian officials say migrant numbers have risen again somewhat with warmer summer weather arriving, with some trying to cut through the fence despite a heavy police presence.