The three former Communist countries were condemned by Eleanor Sharpston QC who branded their hardline stance “self-centred” and accused them of “betraying the founding fathers’ vision for a peaceful and prosperous continent”.
A temporary scheme was introduced in 2015 to redistribute 160,000 refugees from Africa and the Middle East who landed in Italy and Greece.
But the eastern European countries refused to participate, citing security risks and claiming that accepting refugees would be too much of a burden. Hungary and Slovakia unsuccessfully tried to challenge the legality of the quota scheme.
The European Commission launched legal proceedings against them in the European Court of Justice in December 2017 by which Poland and Hungary had failed to take in a single refugee and the Czech Republic had not done so for more than a year.
The scheme itself turned out to be an abject failure and was scrapped in September 2017 after fewer than 30,000 refugees were relocated.
But Ms Sharpston, an advocate general at the Luxembourg-based court, pulled no punches in a statement offering the court’s first opinion on the case.
She said: “These member states cannot invoke their responsibilities with regard to the maintenance of law and order and the safeguarding of internal security in order to disapply a valid EU measure with which they disagree.
READ MORE: Boris’s firm message to illegal immigrants: ‘We’ll send you back!’
“Such self-centredness is a betrayal of the founding fathers’ vision for a peaceful and prosperous continent.
“It is the antithesis of being a loyal member state and being worthy, as an individual, of shared European citizenship.”
She insisted the European Union’s principle of solidarity “necessarily sometimes implies accepting burden-sharing”.
Hungarian government spokesman Zoltan Kovac said: “Outgoing European Commission still insists on resettling migrants in Hungary, but the government position remains unchanged.
“Whether it’s a one-time quota or a permanent compulsory quota, Hungary declines.”
Ms Sharpston and two other British judges will stop working at the EU court once the country leaves the bloc.
She became the first woman to be appointed at the European Court of Justice in April 2008 and has served as an advocate general – a position some say is even more influential than the judges themselves.
It is her role to deliver the first opinion on cases that come before the court, which then go to the judges.
The advocate general’s opinion is not binding but the court’s final judgments generally take the same line.