Berlin: German chancellor Angela Merkel has urged Hungary to quickly implement a ruling by the European Union’s top court that member states must take in a share of refugees who reach the continent.

In its ruling last week, the court dismissed complaints by Slovakia and Hungary over the mandatory quotas introduced in 2015 to relocate asylum seekers from Greece and Italy.

File image of German chancellor Angela Merkel. AP

Hungarian Prime Minister Viktor Orban said on Friday his government would not change its anti-immigration stance.

In an interview with Berliner Zeitung to be published on Tuesday, Merkel insisted that Hungary had to implement the court ruling.

"It’s unacceptable that a government says a ruling of the European Court of Justice does not interest them," Merkel said, according to a preview published by the daily late on Monday.

Asked whether this meant that Hungary had to leave the European Union, Merkel said, "This means that a very fundamental question of Europe is being touched — because for me, Europe is an area of the rule of law. We will have to talk about this at the European Council in October."

During the Mediterranean migrant crisis of 2015, hundreds of thousand of refugees arrived in the Balkans, Italy and Greece. That prompted the European Union to impose mandatory quotas on its member countries for relocating asylum seekers.

The flow of migrants has since receded, easing pressure to force compliance on nationalist leaders like Orban, who is benefiting domestically from his tough anti-immigrant policies as elections approach in 2018.

Merkel told another newspaper in an interview published over the weekend that she was optimistic that a dispute over how to distribute asylum seekers in the European Union would soon be resolved.

The Frankfurter Allgemeine Sonntagszeitung also reported that in negotiations between member states about redistribution, a compromise was starting to emerge that would link accepting refugees to payments from the European Union.