The Polish government took its pick-and-mix approach to EU law to a new level on Monday — asking the bloc’s top court for help just days after rejecting its jurisdiction in key areas.

Poland, along with Hungary, asked the Court of Justice of the European Union (CJEU) to strike down a new measure that allows the EU to cut off funds from the bloc’s budget to countries considered to be breaching the rule of law.

In a years-long battle over core values, EU institutions have accused both Warsaw and Budapest of backsliding on the rule of law and basic democratic standards. Monday’s hearing in Luxembourg, before a panel of red-robed judges in the court’s imposing Grand Chamber, opened a new front in that conflict.

The new measure, passed in December last year, would not allow the EU to stop funds simply due to general concerns about the rule of law. But it would allow the bloc to act over rule-of-law shortcomings that affect the sound management of the budget or the EU’s financial interests — for example, if national courts were not considered to be independent.

That has raised alarm bells in Warsaw and Budapest, where governments fear they could lose out on millions of EU cohesion funds and other economic development cash. Officials expect the European Commission to trigger the measure for the first time in the coming weeks, although it’s unclear which countries will be targeted.

And so, just a few days after the Polish Constitutional Tribunal — backed by the government — ruled that the CJEU had no power to intervene on the country’s controversial judicial reforms, lawyers for the Polish and Hungarian governments asked the very same court to come to their aid.

The lawyers argued that the measure — sometimes known as the “rule-of-law conditionality mechanism” — was not intended to protect the EU budget but to administer a political punishment.

“It’s not a conditionality regime, it’s a mechanism to impose a sanction,” said Sylwia Żyrek, a lawyer representing the Polish government.

Miklós Zoltán Fehér, a senior official from the Hungarian Ministry of Justice, told the court that the measure was a “political procedure with the political intent.”

The two lawyers also argued that the measure was a back-door attempt to apply the so-called Article 7 procedure, under which member countries can be stripped of voting rights inside the EU if they are found to have breached core values. Both Poland and Hungary have been the subject of such proceedings for years but other member states haven’t been able to agree on a conclusion.

At Monday’s hearing, both countries also argued that the rule-of-law provisions in the new measure aren’t sufficiently defined and that the mechanism does not give certainty and clarity for member states.

But lawyers for the Commission, the Council of the EU, the European Parliament and 10 member countries — including Germany, France, the Netherlands, Denmark and Ireland — lined up to defend the measure.

“A breach of the rule of law in a member state clearly poses a risk to the implementation of the EU budget,” argued Tamas Lukacs, a lawyer for the European Parliament.

He also rejected the accusations that the new mechanism is a substitute for the Article 7 procedure. “The two procedures have different objectives,” he said, stressing that the mechanism doesn’t have “punitive or retaliatory” character.

Lawyers for other EU institutions made similar arguments.

The measure formally came into effect in January. But, under a compromise deal late last year, EU leaders asked the European Commission to refrain from implementing it pending any challenge in the Court of Justice.

Members of the European Parliament, however, have put significant pressure on the Commission to trigger the mechanism, going as far as threatening legal action.

The judgment is not expected for several months.