BUDAPEST (Reuters) - The head of the United Nations refugee agency praised the European Union’s refugee quota system for member states on Tuesday and urged Hungary to drop its resistance to taking in its fair share of migrants.

FILE PHOTO: U.N. High Commissioner for Refugees (UNHCR) Filippo Grandi speaks during a news conference in San Jose, Costa Rica August 30, 2017. REUTERS/Juan Carlos Ulate

Hungarian Prime Minister Viktor Orban is facing criticism over his continued refusal to change his anti-immigration stance despite a ruling by the European Union’s top court this month upholding the bloc’s quota system.

“My impression is there is a very clear intention to limit the number of people coming to Hungary to seek protection,” U.N. High Commissioner for Refugees Filippo Grandi said during a visit to Budapest.

Grandi said the EU’s quota system, introduced at the height of the migrant crisis in Europe in 2015, provided a model for other countries worldwide.

“This was an EU decision... we agree with that decision,” he said. “It was a very good example of sharing that responsibility. It could be used globally... Forced displacement is a global phenomenon like climate change. You can only address it through global solutions and solidarity.”

Grandi, who earlier in the day visited a camp on the Serbian border where migrants are detained while their asylum cases are pending, said razor wire fences and tough legal measures conveyed the wrong message that asylum was a crime.

German Chancellor Angela Merkel, whose country took in the bulk of the migrants who entered the EU in 2015-16, has also urged Hungary to implement the EU court ruling.

Grandi warned EU states in April not to send asylum seekers back to Hungary until Budapest amended a law that allows it to detain migrants at its border.

EU rules allow member states to return refugees to the first safe country they reached on entering the 28-nation bloc.

Orban has branded migrants - most of whom are Muslims from the Middle East and North Africa - a threat to Europe’s historic Christian identity and a “Trojan horse for terrorism”, and he has defended the asylum centers on Hungary’s border.

Grandi said migrants held there were not being mistreated but added that limitations on their freedom of movement while their cases are pending, especially for minors, raised problems.

“Material conditions, food, medical care water, hygiene is acceptable,” he said. “The problem is the detention aspect. People are treated well but in a confined situation.”