Poland’s justice system is in “disarray” for the second time in just over two years as a result of the policies of the country’s Law and Justice-led government.

The history behind the recent attacks on the judiciary helps explain why the Polish government has continued to push forward, despite being called out by the European Union, international organizations, legal experts, former Solidarity leaders and even Mick Jagger. Law and Justice recently returned to power after having led the Polish government from 2005 to 2007, when they were abruptly voted out. A number of the policies they put forward in that first run at leadership were struck down by the courts, leading party chief Jaroslaw Kaczynski to conclude that in order to maintain power he needed to control, or at least hamstring, the judiciary.

Law and Justice espouses a paternalistic and religious form of populist nationalism. It contests the legitimacy of the liberal order under which Poland’s government was structured after the fall of communism, arguing that its members did not consent to these values. It claims a broad mandate to tear down liberal structures and “re-Christianize” Poland. A proposed constitution drafted by the party in 2010 not only contained provisions severely eroding the judiciary’s ability to act as a check on executive and legislative power, but it also provided that individual rights could be curtailed by legislation if the government deemed this necessary “for the common good.”

Their skepticism of liberal democracy, and of the EU, recall the approach of Fidesz, a right-wing populist political party in Hungary. Many recent Polish policies do seem to track Hungarian developments, such as the government takeover of public media and its refusal to accept migrants, or fund certain types of NGOs. However, when it comes to the legal system, the Polish approach has gone much farther than Hungarian Prime Minister Viktor Orban has; the Polish version was much more of a top-to-bottom routing. And unlike in Hungary, it was done without even an attempt at legal cover.

Poland’s run at the judiciary, moreso than Hungary’s, has resulted in cyclical scenes of chaos. The first round occurred in late 2015. Shortly after winning Poland’s parliamentary election, the new government kneecapped the court, which is charged with interpreting Poland’s Constitution and is known as the Constitutional Tribunal. It illegally seated new judges and imposed new laws that hampered the court’s functioning by requiring, for example, that it only hear cases in the order in which they were filed. The seating of these new judges, and a number of the new laws, violated the Constitution. The Tribunal pointed this out. The government waved off the court’s decisions that it disagreed with, and refused to publish them.

In the midst of the standoff, Polish courts faced confusion. Some decided to follow the new laws passed by the government, and ignore the opinions of the Constitutional Tribunal striking them down. Others sided with the constitutional court that the new policies were illegal and refused to follow the government’s new laws. As a result, for a time in 2015 and 2016, until the government completely disabled the Tribunal, constitutional law was in chaos in Poland.

Now we’re witnessing Court System Chaos Round Two. This time, the focus is on the Supreme Court – the highest appellate court for the interpretation of “ordinary” legislation (i.e. not pertaining to the Constitution). The problem began in January this year, when, after a lot of political wrangling and protests, the Law and Justice government passed new laws governing the Court and the body that selects its judges. One new provision required all judges age 65 and over to make a formal request to the president to keep their jobs by July 3, 2018. Analysts noted that this law again contradicted the Polish Constitution, which states that a Supreme Court judge serves a 6-year term, giving no authority over removal to the president. While the new law ostensibly applied to 27 judges on July 3, only nine complied and made the request. Seven actually sent a notice to the president that they would remain on the bench in accordance with the Constitution, in defiance of the law. Nevertheless, President Andrzej Duda initially ordered 15 judges to “retire.”

The chaos ramped up on July 4, when the head of the Supreme Court, in solidarity with a number of other judges that had been “retired” by the president, showed up for work anyway. In a meeting with the president, head judge Malgorzata Gersdorf proposed herself that Judge Józef Iwulski take over her duties, should she be unable to carry them out. When Duda later stated that Gersdorf had retired and Iwulski taken her place, he was corrected by both judges.

Iwulski issued a statement trumpeting, “President Andrzej Duda neither appointed me, nor did he entrust any duties to me.” Finally, Gersdorf said she would take some vacation time to clear the air. Still unknown is what will happen when her “vacation” is over. There is no clarity as to who will hear Supreme Court cases, or what will happen if others of the 15 “retired” judges show up for work in the future. It’s likely they will be forcibly removed from the premises, which could result in a new round of protests – the last round already garnered tens of thousands of people. And concerning Iwulski; he is himself 66 years old and must now make a request to Duda to remain. Could we see a series of judges cycle through until Duda finds one he likes? Is that the way a legal system should work?

The laws passed in January on the functioning of the Supreme Court also create a new phenomenon called the extraordinary appeal – likely to cause Court System Chaos Round Three. One law creates a new body made up of political appointees – some of whom will be judges and some of whom will be lay persons with no legal experience whatsoever. This group will be empowered to re-hear and re-decide any court case that has been heard by civil, criminal or military courts since October 1997. This means that it could re-decide any Supreme Court decision handed down in the last 20 years. This body of political appointees also has the final say on matters related to elections. Never mind the fact that legal scholars and expert bodies of the EU have told the Polish government that this is a terrible, communist-sounding idea, the government is still gung-ho. Hearings to appoint the laypersons were held the last week of June.

The Law and Justice government prioritizes loyalty above all, and fears (appropriately) that the courts will strike down their policies, which often violate the constitution in substance, and are passed using procedures that themselves violate the law. They argue that the purged judges are “communists,” when what they seem to mean is that the judges are not loyal to the party, or that they express the opinion that rule of law should prevail – instead of politics. Sadly, this party-loyalty test doesn’t just affect the judiciary, it has been applied throughout government ministries and to civil servants as well.

These laws are not normal. They are not, as the government claims, replications of laws found in other Western countries. They are unprecedented, and are doing serious damage to the legal system of Poland. Since November 2015, regular protests have erupted throughout the country, bringing tens or even hundreds of thousands of people into the streets. This happens not just in large cities but even in Law and Justice strongholds throughout the country. The protests involve chants of “free courts!” and “constitution!” Corporate lawyers have even formed a new civil society group to defend judges that are disciplined or fired for illegal reasons.

So why does this matter? And if it matters what should be done?

While some would argue that Poland ruining its democracy is really just Poland’s problem, it isn’t. In front of the world, or at least the West, Poland is attempting to rewrite the international standard for interference with rule of law and judicial independence that will be tolerated within the definition of a “democracy.” The more the EU – and the U.S. – fail to respond with clear consequences, the more we are likely to see these actions spread. Orban in Hungary has already seized on Poland’s strategy, and recently doubled back for a second restructuring of its own judiciary, via constitutional amendment. If the EU fails to obtain any corrective action through its Article 7 Rule of Law Mechanism, through infringement proceedings in the European Court of Justice, or through budgetary restructuring, we could see clearer emulation in places like Romania and Bulgaria, that already seem to be following suit.

The EU has taken far too long to respond. But it now is operating along several channels to slowly ramp up accountability. It shouldn’t hold back. It should recognize that it is not only democracy in Poland that is at stake.

Disabling a functioning legal system could affect Poland’s ability to provide transparent and predictable rules governing society, which could in turn lead to instability. Citizens that perceive a lack of access to fair courts as a place to challenge injustice could take decisive action against the government, or take matters into their own hands. Instability in Poland is, again, not only a matter of concern for Poland, but for its neighbors and its friends.

Poland’s chaotic moves also matter for what they mean to its allies, including its NATO allies such as the United States. NATO has, particularly in the modern era, defined itself as a community of shared values that respect and value “democracy, rule of law, and human rights.” This language, originally appearing in the Warsaw Communique of 2016, was reaffirmed in the declaration signed on July 11 in Brussels, despite the displays of disunity that occurred at the summit itself. But if partners do not agree on what defines the democratic institutions they are fighting to protect, and what values govern these institutions, they are more likely to disagree when interpreting whether phenomena such as disinformation or other ill-defined actions constitute a threat.

The United States should see its relationship with Poland as its best opportunity to course-correct the slide toward authoritarian policies within the democratic world. It provides a better chance for a positive outcome than does the U.S. relationship with either Hungary or Turkey, because Poland will likely listen. When the U.S. Department of State repeatedly expressed concern about a recent anti-free-speech law passed by the Law and Justice government, the government amended the law. When three U.S. senators wrote a letter to Poland’s leaders, softly expressing “concern” about rule of law, arguments over the letter erupted between the Polish public and the government for months afterward. While Poland’s attitude in response to EU rebukes is one of defiance, it reacts with respect and decisive action when the U.S. takes a stand. So, the U.S. should, now, take a stand in favor of joined values and international security. As it should hold itself to these values, it should hold its close ally, Poland, to them as well. And it should call on its ally to recommit to these values by jettisoning policies of legal confusion and chaos.

Photo by Sean Gallup/Getty Images: A man holds up his hand to people participating in a pro-democracy march holding a giant Polish flag on February 27, 2016 in Warsaw, Poland. Tens of thousands of people, many of whom had come from across Poland, marched through the city center to protest against the current government of the Law and Justice party (PiS), which has taken strident steps towards undermining democracy in Poland, including curtailing the power of the Constitutional Court and forcing out critical journalists in state-run media.