WARSAW, Poland — Outrage over plans by Poland’s governing party to put the judicial system under its political control sparked another day of nationwide protests Saturday, with some people gathering outside the home of ruling party leader Jaroslaw Kaczynski and accusing him of being a dictator.

Polish democracy icon and former president Lech Walesa addressed a protest in Gdansk, urging young Poles to fight to preserve the separation of powers that his Solidarity movement helped to achieve more than a quarter century ago when Poland threw off communist rule.

“Our generation succeeded in putting Poland back on track and ensuring the separation of powers,” the former president said. “We cannot allow anyone to destroy that.”

“In 1989 we gave you a democratic Poland. You must fight for it with all means,” said Walesa, 73, who won the Nobel Peace Prize in 1983 for leading Solidarity, the Soviet bloc’s only free trade union.

Later, thousands of government opponents gathered in Warsaw, Krakow and other cities to urge President Andrzej Duda to reject legislation that would give Law and Justice, the conservative ruling party, control of the Supreme Court and the judiciary.

“We are all in danger. Every citizen is in danger now,” said Tomasz Gromadka, a 32-year-old playwright protesting in front of the home of Kaczynski, who is the power behind the government and presidency. “Because now they are taking the courts, then they will take the media, they will take everything. But we still have the streets. This is our power. I think we should do whatever we can.”

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

The party “is about to finish democracy,” said Ewa Krasucka, a 32-year-old photographer. “Honestly I don’t think we will stop him now, but at least in 10 years, in 15 years, when we will still be with these people in the government I will feel good with myself for being here now.”

Many of the protesters then moved to the Supreme Court, where people sang John Lennon’s “Imagine” and held up candles.

Polish democracy icon and ex-president Lech Walesa addresses a large crowd of anti-government protesters in Gdansk, Poland, Saturday, July 22, 2017 (AP Photo)

Polish democracy icon and ex-president Lech Walesa addresses a large crowd of anti-government protesters in Gdansk, Poland, Saturday, July 22, 2017 (AP Photo)

Law and Justice won parliamentary elections in 2015 with nearly 38 percent of the vote, which translated into a slim majority in the parliament. It has maintained support of about 35% to 40% of voters, according to recent polls, with many supporting its cash handouts for families and its conservative and pro-Catholic worldview.

The party says the changes are needed to reform a justice system that Kaczynski says was never purged of former communists after that system collapsed in 1989.

In Warsaw, 29-year-old lawyer Marzena Wojtczak disputed that logic, saying many judges working today had actually been anti-communist dissidents and others are too young to have been communists.

Demonstrations have taken place almost every day in Poland over the past week as lawmakers pushed forward with the legislation to impose greater control over the courts.

“This will sound strange, but this is the worst and best moment in Poland since 1989,” Tomasz Lis, the editor of Newsweek Polska and an outspoken government critic, said on Twitter. “A great nation is defending democracy and its own freedom.”

The Supreme Court’s powers include ruling on the validity of elections, and government critics fear the ruling party could use friendly judges to falsify future elections. They also fear the courts, under political pressure, will prosecute political opponents.

Anti-government protesters raise candles and shout slogans, as they gather in front of the Supreme Court in Warsaw, Poland, Saturday, July 22, 2017 (AP Photo/Alik Keplicz)

Anti-government protesters raise candles and shout slogans, as they gather in front of the Supreme Court in Warsaw, Poland, Saturday, July 22, 2017 (AP Photo/Alik Keplicz)

After winning power in 2015, Law and Justice has acted quickly to cement its power, prompting numerous street protests.

The party has asserted control over government-owned media, purged the army of most of its leadership and has neutralized the power of the Constitutional Tribunal to block any new legislation that might violate the constitution.

On Saturday, presidential spokesman Krzysztof Lapinski said Duda sees some flaws in the new 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.

The European Commission has expressed its concerns about Poland’s judicial changes and recently threatened to strip Poland of its EU voting rights, but has so far proven powerless to do anything. Any sanctions would require unanimity of the remaining 27 EU members.