The Polish Parliament’s move on Saturday to subvert judicial independence has opened a searing debate about whether a nation once held up as a paragon of post-communist democracy has slid back into a darker era.

The Senate’s 55-23 vote on the measure, which is widely expected to be signed into law by President Andrzej Duda, capped a 20-month procession by the right-wing ruling Law and Justice party to bring Poland’s independent institutions under its control. The swift offensive has left leaders who toppled communist rule in 1989 to question whether they succeeded in embedding democratic norms in a state that was under Soviet domination for decades. 

Lech Walesa, a former Polish president and leader of Solidarity, the labor union that helped precipitate communism’s fall across Europe, called Saturday for a mass effort to reengage citizens about the importance of the separation of powers.

“Our generation managed, in the most improbable situation, to lead Poland to freedom,” he told a crowd gathered in Gdansk’s Solidarity Square. “You cannot let anyone interrupt this victory, especially you young people.”

The erosion of the rule of law also raises difficult questions for the European Union, which once saw Polish democracy and prosperity as its biggest success after the 2004 expansion that encompassed much of Eastern Europe. Now, E.U. leaders are threatening to suspend Poland’s voting rights in decisions of the bloc, though they may be thwarted by the veto of Hungary's leader, Viktor Orban, another post-communist prime minister who has centralized power in defiance of democratic norms. 

Opposition supporters shout slogans and raise lights and candles as they protest in front of the Supreme Court against a law on court control in Warsaw, Friday, July 21. (Alik Keplicz/AP)

Poland’s disregard for the E.U.’s warnings — and the opposition of tens of thousands of protesters who have taken to the streets in recent days — comes amid a global wave of nationalism that crested last year with Britain's decision to leave the E.U. and the election of Donald Trump. Saturday’s vote, which unfolded soon after Trump visited Warsaw and praised its populist leaders, may be another measure of the transatlantic echoes of the American election. 

The U.S. State Department sounded an alarm about the measure, which would cast out all current justices of the Supreme Court, except those handpicked by the governing party’s justice minister. But Trump’s visit was tacit support for Law and Justice leaders, said Michal Kobosko, director of the Atlantic Council’s Warsaw Global Forum, and “encouraged them to move forward with their offensive against the courts.” Another measure would dissolve the independent body that selects judges. And the Constitutional Tribunal, the authority capable of invalidating the legislation, has been filled with government loyalists.

Behind the monument to the Warsaw Uprising of 1944, the backdrop for Trump’s speech, sits the Supreme Court. Its top judge, Malgorzata Gersdorf, said she will probably lose her job as a result of the changes. She is scheduled to meet Monday with Duda, the president and a former Law and Justice member of Parliament. He is a close ally of Jaroslaw Kaczynski, the architect of the effort to bring the courts to heel.

Gersdorf said the judiciary is the last independent institution protecting citizens from an authoritarian state whose aim, she said, is removing legal obstacles to interference in elections. The government has already clamped down on public media and restricted democratic assembly

“The last barrier is the Supreme Court,” she said in an interview. “This change would undo our democratic system based on the independence of the courts. Each citizen has to know that a judge won’t fall in front of political power.”

According to Law and Justice, however, the courts are riddled with corruption, a product of lingering communist influence. The charge, said Jan Gross, a Polish-born professor of Eastern European history at Princeton University, is “total nonsense.” He called the proposed changes “an indigenous assault on democracy and decency.”

Law and Justice calls them democracy in action. “A professional and honest system of justice is a dream of many Poles,” said the ruling party’s justice minister, Zbigniew Ziobro. “Poles chose our program. This is democracy.” 

Polling suggests that a majority of the country wants Duda to veto the legislation. At the same time, there is strong support for Law and Justice, which leads its closest competitor, the center-right Civic Platform, by double digits. 

Zygmunt Poziomka, a former coal miner who stood wrapped in a Polish flag outside the Senate building Friday, said Law and Justice was returning control of the courts to people ill-served by negotiations in 1989 over Poland’s post-communist future.

“The communists are still there — just the sons instead of their fathers,” said Poziomka, 58. “It’s been 72 years since World War II, and they still won’t let Poland have a chance. Finally Trump let the world see that Warsaw had an uprising, that we fought and had a vision.”

Kaczynski, the leader of Law and Justice, is the son of a veteran of the uprising, and his political vision is defined by national victimhood, not just in World War II but in the decades since, Gross said. The most powerful politician in Poland, Kaczynski continues to insist that a 2010 plane crash that killed his brother, Lech Kaczynski, then the nation’s president, was orchestrated by the Russians, with the help of Civic Platform and its leader at the time, Donald Tusk, who is now president of the European Council.

“This is the underlying dispute that defines Polish politics right now,” said the Atlantic Council’s Kobosko. 

Conspiracy theories, as well as the government’s broadside against the courts, have found support among people “left out by the transition from communism,” said Rafal Trzaskowski, a Civic Platform member of Parliament. “These are people who don’t travel or use the infrastructure that came with integration, and we failed to communicate with them.”

Law and Justice, he said, uses that resentment to deny the legitimacy of negotiations in 1989 that brought a peaceful end to communism — talks in which Jaroslaw Kaczynski and his brother played a minor role and later dismissed as the collusion of elites.

“This is the beginning of the end of a democracy,” Trzaskowski said, lamenting that opposition lawmakers could do little beyond joining the demonstrations.

One protester, Radomir Szumelda, a leader of the Committee for the Defense of Democracy, a civic group promoting liberal values, said the aim is to sustain public outcry until the government takes notice. In particular, he said, they are seeking to pressure the president to veto the legislation, which remains unlikely even though Duda expressed some concerns Saturday through a spokesman.

“We will show that we refuse to live without freedom,” said Szumelda, 45. “Young people who didn’t live under communism may not know what that was like, but they are also joining us, and together we are saying that we can’t go back.”

Protester Sasza Reznikow, a 31-year-old actor, immigrated to Poland from neighboring Belarus in 2006 to escape the dictatorship. Now, he said, he sees Poland lurching to the East.

Klaudia Kocimska and Magdalena Foremska in Warsaw and Michael Birnbaum in Brussels contributed to this report.