Poland’s Foreign Minister Witold Waszczykowski announced his country’s intention to defy the latest European Court of Justice (ECJ) ruling that would force Poland to take in migrants.

The Polish foreign minister said that even if the European Union (EU) threatens Poland with action, the Polish government will continue to refuse to take in migrants from Greece and Italy, Der Spiegel reports.

“The security of Poland is more important than the unjustified decisions of the European institutions on refugee issues,” he said.

Mr. Waszczykowski made his remarks in reaction to a ruling by the ECJ which rejected an appeal from the Hungarian and Slovakian governments who claimed that the redistribution of migrants was not legal as it did not have unanimous consent from all member states.

The foreign minister has been backed by Poland’s prime minister, Beata Szydło, who said that the country would flatly refuse to participate in the migrant redistribution programme. Szydło expressed that she was not shocked by the court’s ruling but noted it “absolutely does not change the position of the Polish government with respect to migration policy”.

The Hungarian government reaction to the ruling has also been deeply critical of the ECJ. Hungarian Foreign Minister Péter Szijjártó said the ruling “was not a legal or professional one but a political one” and slammed the EU as having “raped European law and European values”.

Hungary: EU Forcing Countries to Take Migrants Is ‘Political Rape’ https://t.co/O2YZGe0Kau — Breitbart London (@BreitbartLondon) September 7, 2017

Earlier last week, Hungarian Prime Minister Viktor Orbán wrote a letter to European Commission President Jean-Claude Juncker stating that Hungary “is not an immigrant country, does not want to become an immigrant country and cannot accept being forced to change this”.

Both Poland and Hungary, who are part of the Visegrád group along with the Czech Republic and Slovakia, have become deeply critical of the EU and the political bloc’s involvement in their internal affairs.

The EU has threatened to suspend the voting rights of Poland after the country attempted to pass major judicial reform and has made similar threats to Hungary who have been attempting to hold foreign-funded NGOs linked to left wing billionaire George Soros to account.