BUDAPEST, Hungary (AP) — Hungary’s new legislation allowing for the detention of asylum-seekers in shipping containers at border camps took effect Tuesday, with the European Union’s commissioner for migration saying that it needs to comply with the bloc’s rules.

Dimitris Avramopoulos said that EU and Hungarian experts will meet to discuss the new law, which has been sharply criticized by U.N. agencies and human rights advocates.

The new legislation is meant to complement the fences built by Hungary in 2015 and this year on the borders with Serbia and Croatia. The barriers have drastically reduced the number of migrants able to pass through the country on their way to Germany and other destinations in Western Europe.

“We decided to work together through our experts and ensure that EU rules also are complied with,” Avramopoulos said after meeting with Hungarian officials. “The European principles have been jointly and unanimously agreed by all member states and should therefore be respected and implemented by everyone, too.”

“This implies giving effective access to the asylum procedure while fighting against abuses, but also ensuring a fair review of decisions,” the commissioner added.

Interior Minister Sandor Pinter said that while there was agreement with the EU about the need to increase European security, there were differences on how to deal with migrants trying to enter countries while avoiding regular border controls.

“Our positions came closer even today and by the summer, we will find a way to express a common position,” Pinter said.

Human Rights Watch, a New York-based group, said that the commissioner’s visit was “long overdue” and noted that other countries in the region, like Poland and Slovenia, were following Hungary’s example by adopting similarly restrictive asylum rules.

Hungary’s new rules are “designed to make it difficult to seek asylum there, and unpleasant or downright dangerous for those who do,” said Lydia Gall, an HRW researcher in Eastern Europe.

She said that “Avramopoulos should demand that Hungary change course. He should also be willing to use legal enforcement action if Hungary fails to comply.”

Meanwhile, the Hungarian Helsinki Committee, an advocate for asylum-seekers, said that a temporary order late Monday from the European Court of Human Rights was meant to prevent Hungary from taking eight teenagers and a woman with a high-risk pregnancy from refugee reception centers to the shipping container border camps.

“The rules coming into force today simply deny protection to children, deny protection to refugees and essentially resort to illegal detention,” said Marta Pardavi, the Helsinki Committee’s co-chair.

Gyorgy Bakondi, Prime Minister Viktor Orban’s national security adviser, said that 88 asylum-seekers, including 21 unaccompanied minors between the ages of 14 and 18, were now in reception centers around the country and could be taken to either of the two transit zones on the Serbian border, in the towns of Roszke and Tompa.

“We took these legal steps so that no one is able to enter Hungary illegally,” Bakondi said. “Our aim is to decrease the security risk markedly present in Europe since 2015. We are protecting not only Hungary’s borders, but Europe’s as well.”

U.N. children’s agency UNICEF has also expressed concerns over that fact that unaccompanied minors older than 14 will also be detained in the border camps.