Hungary's constitutional court has struck down a bid by Prime Minister Viktor Orban's government to challenge a ruling by the EU's top court against Budapest's harsh asylum policy.
Budapest had asked the court earlier this year to review a ruling from the European Court of Justice ordering it to suspend a law that allows police to deport or physically "push back" asylum seekers across the Serbian border.
The petition by Justice Minister Judit Varga "cannot be the subject of a review of the ECJ judgment," nor can it lead to an "examination of the primacy of EU law," the Hungarian court said.
But it said that in areas of joint legal jurisdiction between Brussels and Hungary, Budapest has the right "to ensure the effectiveness of the joint exercise of competences".
Last month, during a trip to Budapest, EU Justice Commissioner Didier Reynders said the challenge to the ECJ ruling was "unacceptable".
The Hungarian move mirrored a Polish constitutional court ruling that challenged EU law.
In October, Mr Orban signed a government resolution in support of Warsaw that called on EU institutions to respect the sovereignty of the bloc's 27 member countries.
"The primacy of EU law should only apply in areas where the EU has competence, and the framework for this is laid down in the EU's founding treaties," the constitutional court said.
National law-enforcement bodies, in particular constitutional courts and tribunals, have the right to examine the scope and limits of EU competences, it said.
Budapest, like Warsaw, has been engaged in a tussle with Brussels over legislation targeting LGBTQ people, independent media and civil society.