The Court of Justice of the European Union has decided that member governments can’t depart from EU law to maintain public order | John Thys/AFP via Getty Images Top court rules Warsaw, Budapest and Prague breached EU law over refugees Court rejects countries’ use of national security to justify staying out of relocation scheme.

Poland, Hungary and the Czech Republic breached EU law by refusing to take an active part in the EU’s one-off relocation scheme for refugees in 2015, the EU’s top court ruled on Thursday.

In its final judgment, Court of Justice of the European Union decided that member governments can’t depart from EU law just because they claim they want to maintain public order and national security in their countries, without giving “consistent, objective and specific evidence” of potential danger.

During the migration crisis in 2015, EU leaders decided that 160,000 asylum seekers in Italy and Greece should be relocated around the Continent.

However, Poland and Hungary failed to relocate any migrants, while the Czech Republic relocated only 12 people out of the 50 refugees it said it would accept.

In December 2017, the European Commission took the three Central European countries to court, claiming they broke the EU law by refusing to participate in the scheme.

The court rejected arguments that all the migrants could pose a threat.

Poland and Hungary argued that they were entitled not to follow the scheme, citing an EU treaty provision that says that member countries have the responsibility to maintain the law and order and to safeguard the internal security in their countries.

But the court disagreed, saying that provision “does not confer on Member States the power to depart from the provisions of European Union.”

The court rejected arguments that all the migrants could pose a threat, instead finding that countries would have to prove a threat existed from a specific person.

The court added that EU countries should have taken national security and public order into consideration throughout the relocation procedure, but they also had to “rely, following a case-by-case investigation, on consistent, objective and specific evidence that provides grounds for suspecting that the applicant in question represents an actual or potential danger.” The judges said that provision shouldn’t be used “for the sole purposes of general prevention.”

The emergency relocation scheme expired in September 2017 after some 30,000 people were relocated. All three countries argued in court that the Commission’s complaint should be inadmissible, as the scheme is no longer operational.

The judges in Luxembourg rejected that claim, saying the Commission is now only seeking the ECJ's declaration that the three countries broke the law, and that the judgment can establish a basis of responsibility for other EU countries.

The three countries could be fined for their violation.