On Friday, the European Union’s highest court ordered the Polish government to immediately halt its ongoing purge of Poland’s Supreme Court. The Luxembourg-based European Court of Justice (ECJ) ordered Polish authorities to suspend implementing its April 2018 “Law on the Supreme Court”; to reinstate all of the Supreme Court judges who were forced to retire under the law; and to refrain from any further attempt to replace them — including the Supreme Court’s chief justice.

Poland’s government claims the Law on the Supreme Court is simply part of a broader reform and reorganization of the national judiciary. However, critics have depicted it as a thinly disguised attempt to capture the Supreme Court, going against not only the Polish Constitution but also the principle of judicial independence enshrined in E.U. law. Poland’s Supreme Court continues to resist this takeover and is locked in a pitched battle with Poland’s ruling party, Law and Justice (PiS).

By intervening on the side of the Supreme Court, the ECJ has entered battle with the Polish government. Poland’s PiS-affiliated president, Andrzej Duda, had recently ignored a second national court’s order to stop appointing new judges to the Supreme Court and insisted that the Supreme Court’s head judge, Malgorzata Gersdorf — who continues showing up to work at the court up to this day — was automatically “retired” under the law in July.

Why is the E.U. involved in a dispute over national courts? It is because these courts are simultaneously both courts of their national legal system and E.U. courts, charged with enforcing E.U. law. This gives the E.U. an interest in ensuring that national courts are independent, as otherwise E.U. law would effectively cease to function in the country. Moreover, because the E.U.’s interconnected legal system is based on mutual trust between national judiciaries, the system will unravel if judiciaries stop trusting one another.

This battle has been going on for nearly three years

The ECJ interim injunction is one step in a battle over Poland’s judges that has been escalating since December 2015. This began with the new PiS government’s capture of Poland’s Constitutional Tribunal in 2016 and continued with laws designed to establish the party’s control over the judiciary as a whole.

The E.U. responded to these moves with escalating warnings. By last December, the European Commission had for the first time activated a procedure laid down in the E.U. treaties (the Article 7 procedure) that could, in theory, lead to the imposition of sanctions on Poland for breaching E.U. values. This procedure, however, is unlikely to lead to concrete sanctions because it requires all other E.U. states to agree to them, and Hungary, which has also turned away from liberal democracy, has promised to protect Poland. Accordingly, Polish authorities have ignored pressure from the E.U. — as well as from tens of thousands of their own citizens who have taken to the streets in protest — and pressed ahead with their judicial takeover.

The government was about to take over the judiciary

The new law would have been the final step in the government’s capture of the judiciary, which critics see as “basically a constitutional coup d’etat.” It retroactively lowered the retirement age for Supreme Court judges from 70 to 65, so that nearly 40 percent of the sitting Supreme Court judges could be forced into retirement, including Gersdorf, the first president of the Supreme Court who has harshly criticized the government’s attacks on the rule of law. The law also empowered the president to pack the court with new judges (the number of Supreme Court judges was increased from 93 to 120) with the help of a PiS-controlled “national judicial council.” The Law on the Supreme Court was viewed by the European Commission and many other international bodies as contravening the principle of judicial independence.

Since the Article 7 procedure was proving ineffective, the European Commission launched an “infringement procedure” against Poland, taking the rare step of asking the ECJ to suspend implementation of the disputed law pending the outcome of the case and the unprecedented step of also asking the ECJ to order that Polish authorities restore Poland’s Supreme Court to its situation before 3 April 2018, when the contested new laws were adopted.” The Commission probably feared that the Polish government was racing to complete its purge, creating new facts on the ground that would be difficult to reverse even if the ECJ were to rule that the Polish law contravened E.U. law.

The ECJ granted the Commission’s request for an injunction, noting that suspending application of the Law on the Supreme Court was urgent because the government was in the process of carrying out a “profound and immediate change in the composition of the Supreme Court” that might irreparably damage the fundamental right to a fair trial before an independent court or tribunal.

The Polish government will be very unhappy

Last Friday’s ECJ injunction was a bold move but at the same time only part of an ongoing process. The ECJ gave Polish authorities a month to explain how they will comply with its order, which they may use to press ahead with their purge. The commission could then request that the ECJ impose penalty payments on the Polish government for noncompliance. The interim order does not tackle the issue of the new judges appointed to the Supreme Court under the disputed law, although its final decision may very likely address this question.

The ECJ has stepped into the breach to defend Poland’s beleaguered courts. However, the PiS government is unlikely to back down without a fight. It remains to be seen whether the ECJ will succeed in defending the judiciary in Poland.

Daniel Kelemen is a professor of political science and law and the Jean Monnet chair of European Union politics at Rutgers University. Laurent Pech is a professor of European law, the Jean Monnet chair of European public law, and the head of the law and politics department at Middlesex University London.