Hungary on Thursday announced it will shut down the transit zones holding hundreds of asylum seekers along its southern border to comply with the European Union’s top court.

Prime Minister Viktor Orban's chief of staff said some 280 asylum-seekers will be moved Thursday to reception centers in the country.

Gergely Gulyas also said that those seeking to asylum in Hungary in the future will have to present their claims at Hungarian diplomatic missions in other countries.

FILE: The transit zone for asylum seekers is pictured in Roszke, Hungary. 

The government decision comes after the European Union's court of justice last week ruled that holding asylum-seekers in Hungary's transit zones amounted to "detention" and set a maximum period of four weeks.

The Hungarian government has compared the zones to the transit areas of airports, where passengers remain if they are changing planes but not entering the country. The reception centers, by contrast, are semi-open.

"The government does not agree with the court's decision, which it considers to be risky and damaging in terms of Europe's security," Gulyas said. "At the same time, as a member of the European Union, naturally we are obliged to comply with every court decision, and we will comply."

ANTI-LOCKDOWN PROTESTS BREAK OUT IN LONDON, WARSAW, OTHER EUROPEAN CITIES AS CORONAVIRUS SHUTDOWNS LINGER

"We think that the transit zone was a solution that guaranteed the possibility of filing asylum requests while at the same time it protected Hungary's borders and, therefore, Europe's external borders, as well," Gulyas said. "The protection of the external borders is an issue in which Hungary cannot, does not want to and will not yield."

Gulyas pointed out that while the EU's Court of Justice considered holding asylum-seekers in the transit zones as detention, a November 2019 judgement by the European Court of Human Rights had reached a different conclusion, saying that the policy did not constitute a deprivation of the "right to liberty and security."

Hungary built fences protected by razor wire on its southern borders with Serbia and Croatia and later a pair of transit zones on its border with Serbia after the 2015 migrant crisis, when some 400,000 people passed through Hungary on their way to Western Europe.

CLICK HERE TO GET THE FOX NEWS APP

The measures were part of Orban's increasingly strict anti-immigration policies and the extreme minimization of Hungary's asylum system. Domestic and international rights groups widely criticized the transit zones built from shipping containers.

The Associated Press contributed to this report.