The EU's top court on Wednesday dismissed a challenge by Slovakia and Hungary over the bloc’s mandatory refugee quota program, an issue that has divided eastern European states from other members.

The European Court of Justice upheld the EU’s right to order national governments to take in their fair share of asylum seekers, arguing that "the mechanism actually contributes to enabling Greece and Italy to deal with the impact of the 2015 migration crisis and is proportionate."

The ruling means that Hungary and Slovakia could face fines if they refuse to abide by the quota system.

The mandatory quota system was approved in September 2015 by a majority of EU member states, but was rejected by Slovakia, the Czech Republic, Romania and Hungary. Poland supported the plan, but later strongly opposed it when the right-wing PiS government came to power.

Unanimous decision not required

The burden sharing agreement was struck despite the EU's so-called Dublin rules, which requires immigrants to apply for asylum in their country of first arrival.

Read more:Glossary of terms: asylum seekers, refugees and migration

Slovakia and Hungary argued the EU broke its own rules and exceeded its powers when it approved the quota system with a "qualified majority," or about two-thirds vote.

The ECJ said in its ruling that the EU "was not required to act unanimously when it adopted the contested decision."

The legal challenge was also backed by Poland, which alongside Hungary has not taken in any asylum seekers. Slovakia and the Czech Republic have only taken in a handful. All four countries also say migrants will disrupt their societies and the EU's focus should be on protecting its external borders.

EU praises court decision

The European Commission, the EU executive, welcomed the ECJ ruling.

"ECJ confirms relocation scheme valid. Time to work in unity and implement solidarity in full," said EU Migration Commissioner Dimitris Avramopoulos.

German Foreign Minister Sigmar Gabriel said that the ruling means eastern European members must abide by the refugee sharing scheme.

"I always said to our eastern European partners that it is right to clarify questions legally if there is doubt. But now we can expect all European partners to stick to the ruling and implement the agreements without delay," Gabriel said in a statement.

Slovakia said that it accepted the top court decision but it was still against the refugee scheme.

"Our position on quotas does not change," Prime Minister Robert Fico said. "We will continue to work on having solidarity expressed in different ways other than forcing (on us) migrants from other countries that don't want to be here anyway."

In Budapest, Hungarian Foreign Minister Peter Szijjarto called the court's decision "outrageous and irresponsible."

"This decision jeopardises the security and future of all of Europe," he told a press conference, adding that the decion was political. "Politics has raped European law and values," he said.

Quota scheme unfulfilled

Only 24,000 of 160,000 refugees from Greece and Italy have been transferred to other states under the EU's refugee burden sharing policy. Under the policy, Hungary is required to take in 1,294 refugees and Slovakia 902.

The European Commission is also carrying out legal action against the Czech Republic, Hungary and Poland for refusing to implement the EU directive.

The ECJ ruling is a victory for western European states like Germany, France and Italy, who have pushed for EU "solidarity" over the migration issue.

Nearly 1.7 million migrants have arrived in the EU from the Middle East and Africa since 2014. Migration flows have slowed since 2016, when the so-called Balkan route was largely closed and an EU migration deal with Turkey brought boat crossing to Greece down to a trickle. The EU has meanwhile sought to reduce migrant crossings from Libya.

Watch video 03:35 Refugee verdict: a setback for Hungary and Slovakia? DW's Georg Matthes

cw/ng (AFP, Reuters)