Wojciech Sadurski is professor of jurisprudence at the University of Sydney, professor at the University of Warsaw’s Centre for Europe, and visiting professor of law at Yale Law School. He is the author of “Poland’s Constitutional Breakdown” (Oxford University Press, 2019).

Poland’s ruling party was supposed to be on its best behavior.

Parliamentary elections in October handed the ruling Law and Justice (PiS) party a second consecutive term in power but also saw it obtain 1 million fewer votes than a coalition of opposition parties.

With presidential elections on the horizon in May — where PiS wants its president, Andrzej Duda, to be reelected — most observers had expected the party to play nice in an effort to attract more moderate voters. Instead, it has lurched further to the right, with a slate of draconian judicial reforms that effectively censure judges for implementing EU law.

If it hadn’t already done so, it would seem unthinkable that the Polish government — an EU member after all — would try to get away with this latest power grab. And yet, that’s exactly what is happening. And the consequences could be disastrous for the EU.

The law is breathtaking in its scope and evidence of the political capture of the judiciary.

In December, the lower chamber of the Polish parliament — known as the Sejm — voted to pass a gag law on judges. The legislative process was fast-tracked and enacted without any consultation or expert advice.

Under the new law, judges can be punished for implementing a judgment of a supranational court which, legally speaking, has primacy over domestic law. They can face sanctions for merely asking a higher court in the judicial hierarchy whether a judge on one of their cases has been validly appointed.

They are also barred from any “public actions inconsistent with judicial independence” — read, statements on public matters with which the executive does not agree — or any action that is deemed to “significantly hinder the functioning of the system of justice.”

Punishment can take the form of a transfer to another position or expulsion from the judiciary. These would be meted out by lawyers accountable to the minister of justice, and appointed by the ruling party’s parliamentarians.

The law is breathtaking in its scope and evidence of the political capture of the judiciary. Contrary to the assurances by its authors in the justice ministry that it merely mimics similar regulations in unimpeachably democratic states — France or Germany, for instance — nothing remotely similar exists in any self-respecting democratic state.

In any state governed by the rule of law, the only recourse against an (allegedly) bad judgment is to appeal to a higher court. Nowhere can politicians “discipline” judges for the substance of their judgments. But this is precisely what the law in Poland will allow.

The law now awaits the opinion of the Senate, which is held, by the thinnest of margins, by the opposition. But the Senate can only delay the law’s coming into force — all of its proposed amendments and changes can (and will) be overridden by the PiS-controlled Sejm.

The party’s decision to move ahead with these reforms may be a reaction to serious new competition from the right. The October election saw an extreme right-wing party, Konfederacja (Confederation), enter parliament for the first time with more than 1.2 million votes (nearly 7 percent of the voting public).

Confederation is a toxic mix of laissez-faire libertarians, radical nationalists, rabid anti-Semites and anti-EU fanatics. It’s possible that PiS’s leader, Jarosław Kaczyński, rationalized he has more to gain from attracting extreme right-wing votes than he will lose from further alienating moderates.

In any case, the trigger for the new gag law was a combination of EU legal actions toward Poland and the resistance of many Polish judges to PiS’s anti-constitutional push to control the judiciary, as most recently evidenced by massive protests on the streets of Warsaw.

The Court of Justice of the EU has already issued a long list of judgments condemning laws to overhaul the judiciary in Poland. In a November ruling, the EU court basically stated that Poland’s newly reconstituted Council of Judiciary — a body responsible for all judicial appointments and demotions — is inconsistent with EU standards of judicial independence.

The institution, the EU court implied, had come into existence through the unconstitutional removal of the guaranteed term of office of the prior Council. It also took issue with the fact that ruling party politicians now have the power to appoint 23 out of its 25 members and used the same test to assess another new PiS creation, the so-called Disciplinary Chamber — essentially a mechanism to discipline and punish judges.

The Court in Luxembourg did not pronounce these institutions illegitimate in so many words; rather, it provided Polish courts with criteria to use to establish for themselves whether the “new” Council and Chamber meet the standards of judicial independence.

On December 5, Poland’s Supreme Court declared the Disciplinary Chamber illegitimate. In a series of later judgments pioneered by Paweł Juszczyszyn, a judge in a regional court in Olsztyn, lower court judges began asking the Supreme Court whether the Council of Judiciary meets the standards laid down by the Luxembourg court. So they started doing precisely what they are mandated and required to do — apply the law as interpreted by higher courts.

The real danger of Poland’s judiciary “reforms” is not just democratic backsliding, but Polexit.

This display of judges’ integrity — and their adherence to EU law — was too much for Kaczyński, who correctly considers this to be the biggest challenges to his steady expansion of authoritarian rule. Hence the new statute.

The only glitch is a big one: The EU’s whole legal architecture, established since case law in the 1960s, rests upon the primacy of EU law and its direct effect in EU member countries.

And while no PiS politician actively wants Poland to exit the EU, they have even less appetite for a system in which EU law takes priority and allows European institutions to call out democratic defects in a member state.

The value of the EU as a generous cash cow has run its course anyway, in their eyes, and they are not on board with the pill they are made to swallow along with the generous checks: European values.

Make no mistake. The real danger of Poland’s judiciary “reforms” is not just democratic backsliding, but Polexit. It’s likely that PiS would consider that a price worth paying.