The European Court of Justice overruled Hungary and Slovakia's objections to the compulsory fixed-quota scheme, the BBC reports on Wednesday.
Hungary has not accepted a single asylum seeker since the compulsory quotas were introduced two years ago.
They were an attempt to ease the pressure on frontline countries such as Greece and Italy.
Just under 28,000 people have been relocated under the scheme, rather than the 160,000 asylum seekers envisaged when it was agreed in September 2015.