(CNN)The European Court of Justice (ECJ) has rejected a challenge brought by Hungary and Slovakia against the European Union's power to force member states to admit asylum seekers.
Top EU court rejects Hungary and Slovakia migrant relocation case
The two nations opposed a 2015 decision by the EU's top policy body, at the height of the Mediterranean migration crisis, to assist Italy and Greece by making other EU states admit 120,000 people.
"That mechanism actually contributes to enabling Greece and Italy to deal with the impact of the 2015 migration crisis and is proportionate," a news release on the ECJ's ruling said.
The court "dismisses in their entirety the actions brought by Slovakia and Hungary," it said.
Hungary and Slovakia, along with the Czech Republic and Romania, had opposed the 2015 decision, taken by the Council of the European Union. The formerly Communist nations in eastern Europe claimed they would struggle to absorb mainly Muslim refugees from Syria.
In their case before the ECJ, Hungary and Slovakia argued that there had been procedural flaws and that the decision was neither a suitable response to the migrant crisis nor necessary to deal with it.
While Poland backed their case before the court, Belgium, Germany, Greece, France, Italy, Luxembourg, Sweden and the European Commission argued in support of the council, the ECJ press release said.
In its ruling Wednesday, the court rejected all the arguments brought by Hungary and Slovakia.
The measures were legally taken by the EU Council and did not require ratification by individual governments, its news release said. "Its adoption was not subject to the requirements relating to the participation of national Parliaments and to the public nature of the deliberations and vote in the Council."
It also noted that retrospective assessments of how effective the decision had been could not be used to question its legality.
The court "observes in particular that the small number of relocations so far carried out under the contested decision can be explai