The European Court of Justice has overruled Hungary and Slovakia's objections to a 2015 agreement that sought relocation of immigrants across the country over two years, reported the BBC.
The relocation deal was drawn up to ease the pressure on frontline countries like Greece and Italy, said the report.
While Hungary has not accepted a single asylum seeker since the deal was made, the European Union (EU) has managed to relocate only 28,000 immigrants, falling short of its target of 160,000.
Besides Hungary, Slovakia, the Czech Republic and Romania had objected to the quotas, which the EU officials say was binding on all member states.
We will not give in to blackmail from Brussels and we reject the mandatory relocation quota.Hungary Prime Minister Viktor Orban in an address to the Hungarian Parliament
The Czech Republic took in 12 of its allotted 2,691 refugees before it stopped accepting more, citing security concerns.
The EU had in June decided to initiate legal proceedings against the Czech Republic, Hungary and Poland due to their policies that refused to take in refugees.