WARSAW, Poland (AP) — Polish democracy icon and former president Lech Walesa on Saturday joined the protests that have broken out across Poland over plans by the populist ruling party to put the Supreme Court and the rest of the judicial system under the party’s political control.

The European Union and many international legal experts say the changes would mark a dramatic reversal for a country hailed as a model of democratic transition over the past quarter century, and move Poland closer toward authoritarianism.

The ruling Law and Justice party defends the changes as reforms to a justice system that party leader Jaroslaw Kaczynski says was never properly purged of former communists after that political system collapsed in 1989.

Walesa addressed protesters in Gdansk, his home city and where he led strikes in the 1980s against the then-communist regime that eventually toppled the government and ushered in democracy.

The 73-year-old Walesa recalled those democratic changes, saying that the separation of powers into the legislative, executive and judicial branches was the most important achievement of his Solidarity movement.

“You must use all means to take back what we achieved for you,” he told a crowd that included young Poles. The 1983 Nobel Peace Prize winner also said he would always support their struggle, words that appeared to rule out any leadership role for himself in the protest movement.

He was welcomed with chants of “Lech Walesa!” and “We thank you!”

The changes to the Supreme Court and the judicial system approved by Polish lawmakers must still be signed into law by President Andrzej Duda. More protests are expected Saturday evening in Warsaw urging the president to block them. Duda is officially neutral but has remained closely aligned with the conservative ruling party.

The Supreme Court has, among other powers, jurisdiction over the validity of elections. Government critics fear the ruling party could abuse its new power and falsify future elections.

One protest leader, Pawel Kasprzak, told The Associated Press he also fears the Supreme Court, once it is controlled by the Law and Justice party, could unfairly prosecute political opponents.

After the populist Law and Justice party won power in 2015, it took on the country’s system of checks and balances as it sought to cement its power, often passing contentious laws in the middle of the night and without any public consultation. Those steps have led to repeated street demonstrations.

The party has turned public media into a party mouthpiece and purged the army of most of its leadership. Most dramatically, many critics say, it has already neutralized the power of the Constitutional Tribunal to block any new legislation that might violate the constitution.

At stake now are three separate new laws further overhauling Poland’s judiciary.

On Saturday, presidential spokesman Krzysztof Lapinski said Duda sees some flaws in the legislation on the Supreme Court. But he stopped short of saying whether the president would reject the bill or seek the opinion of the Constitutional Tribunal.

Duda has 21 days to sign the bill into law.

Although the European Commission has expressed its concerns about Poland’s judicial changes and recently threatened to strip Poland of its EU voting rights, it has so far been powerless to do anything. Any sanctions would require unanimity of the remaining 27 EU members and Hungary’s anti-immigration government has vowed to support the government in Warsaw.

On Saturday, Hungarian Prime Minister Viktor Orban said his country will use all available legal means to protect Poland from what he called the EU’s “inquisition campaign.”

____

Pablo Gorondi in Budapest, Hungary, contributed.