Hungary has called on European Union institutions "to respect member states' sovereignty" after it backed a Polish court ruling that some EU law is incompatible with the Polish constitution.
Prime Minister Viktor Orban signed a Hungarian government decree on Saturday, his press chief told state news agency MTI, welcoming the ruling by Poland's Constitutional Court which has plunged the EU into an existential crisis.
Ursula von der Leyen, president of the European Commission, said she was "deeply concerned" by the ruling and that the Commission would do all in its power to ensure the primacy of EU law.
Right-wing populist governments in Poland and Hungary have been at odds with the Commission over issues ranging from media freedoms, migration, LGBT rights to judicial independence.
The two former communist states, which joined the EU in 2004, have been allies within the bloc, often voting in tandem, and supporting each other's case.
Budapest said Thursday's Polish court ruling had been triggered by a "bad practice of EU institutions" which tried to take away certain competences from member states that had never been conferred upon the EU.
"The primacy of EU law can only apply in those areas where the EU has powers, the framework for this had been set out in the EU's treaties," MTI cited the Hungarian decree as saying.
The EU's institutions must respect member states' national identity, it added.
Poland's Constitutional Tribunal took on the case after Prime Minister Mateusz Morawiecki asked it whether EU institutions could stop Poland reorganising its judiciary.
Despite the disputes between Brussels and their respective governments, support for membership of the EU remains high in Poland and Hungary.