The EU's highest court on Wednesday rejected Hungary and Slovakia's objections to a European-wide migration relocation scheme, laying bare an east-west split among EU member states.
The European Court of Justice said in a statement it had dismissed "the actions brought by Slovakia and Hungary against the provisional mechanism for the mandatory relocation of asylum seekers".
In response to the migration crisis in 2015, the EU adopted a decision to relocate asylum seekers who arrived in Italy and Greece, which were dealing with a massive inflow of migrants.
Since compulsory quotas were introduced in September 2015, Hungary has not accepted a single asylum seeker, while nearly 28,000 people have been relocated under the scheme, far below the 160,000 target.
Hungary and Slovakia had asked the court to annul the scheme, claiming that "adoption of the decision was vitiated by errors of a procedural nature or arising from the choice of an inappropriate legal basis".
The countries claimed the relocation scheme was non-binding as they had voted against the deal, together with the Czech Republic and Romania.
In July, the EU Commission threatened the Czech Republic, Hungary and Poland with lawsuits for not implementing the relocation measures.
European Home Affairs Commissioner Dimitris Avramopoulos had said he regretted how certain member states "continue to show no solidarity and to ignore our repeated calls to participate in this common effort".
"None of the arguments they put forward justify [why they] do not implement the relocation decision," Avramopoulos added.
Hungary and Poland remain the only EU states that "have not relocated a single person", while the Czech Republic has not relocated anyone since August 2016, the Commission said.