Hungary and Slovakia looked set to see their appeal against the plan rejected after the advisor to the EU's top court said the quotas were a fair way of easing the pressure on Greece and Italy.
The European Commission meanwhile took its landmark legal action against Poland, Hungary and the Czech Republic to the next level over their refusal to take in any asylum-seekers under the system.
Judges also upheld the bloc's rules saying that asylum claims must be dealt with by the country where refugees first land. They said Croatia must accept migrants deported back from Austria and Slovenia.
EU Migration Commissioner Dimitris Avramopoulos called on the bloc to complete the plan to relocate 1,60,000 refugees from frontline Mediterranean states. But only 24,000 have been taken in by other member states for processing since the plan was agreed in 2015.
More From This Section
"What we need now is a final push to achieve our common goal of relocating the vast majority of the asylum seekers present and eligible in Greece and Italy by September," he said.
He said Brussels was now taking forward legal steps against the Czech Republic, Hungary and Poland "for failing to meet their legal obligations on relocation" after they failed to meet a one-month deadline to respond to the EU's concerns.
The three countries could be hauled up before the European Court of Justice (ECJ) and eventually fined.
The Greek commissioner meanwhile hailed the advice given today by the ECJ's advocate general, or top legal official, which says that Hungary and Slovakia's appeal against the scheme should be struck down.
Slovakia and Hungary filed lawsuits with the European Court of Justice in 2015 shortly after the bloc's leaders pushed through the mandatory quotas over their objections.
Advocates general of the ECJ are regularly called on to give their view before the court makes a final ruling. The court often but not always follows them.
In a separate case, the ECJ dismissed an appeal by a group of asylum-seekers against a decision by Austria and Slovenia to deport them back to Croatia.
But the court backed Austria and Slovenia's decision to send the asylum seekers back to Croatia.
The migrant crisis has fuelled a split in the EU between frontline states like Italy and Greece and mostly eastern European countries that are opposed to migration and rejected mandatory quotas.