Poland’s parliament has approved a bill to give MPs and the justice minister the power to appoint judges without consulting judicial circles.
Opposition parties and human rights groups say this would erode the independence of the judiciary.
The governing Law and Justice party says the reforms are needed because the judiciary is corrupt and serves only the elite.
The bill must now be signed by the president in order to become law.
A demonstration against the changes is scheduled to take place in the capital Warsaw on Sunday.
Since it came to power in 2015, the government of the conservative, populist Law and Justice party (PiS), has passed a series of controversial reforms, triggering mass protests.
Polish senators backed the legislation in a vote in the early hours of Saturday morning.
Earlier this week, Justice Minister Zbigniew Ziobro had argued that the changes were necessary because the current system of appointing judges was undemocratic.
“We want to end corporatism and introduce the oxygen of democracy there. Because Poland is a democracy based on the rule of law.
“This is not court-ocracy,” the minister said.
But opposition parties are concerned that the law would give parliament – dominated by PiS lawmakers – a greater say in appointing judges, violating the constitutional separation of powers.
The legislation will now go to President Andrzej Duda for signing. He has given no indication he plans to veto it.
A separate bill was also presented in parliament this week, which would allow the justice minister to get rid of all of Poland’s Supreme Court judges and appoint new ones.
This piece of legislation was not consulted beforehand and introduced to parliament in the middle of the night, reports the BBC’s Adam Easton in Warsaw.
Under the PiS government, the justice minister already wields considerable power over the prosecution service in his role as prosecutor general because he can influence prosecutors to launch investigations, our correspondent says.
Grzegorz Schetyna, who leads the opposition Civic Platform party, denounced the tabling of the bill as an “announcement of a coup”, the AFP news agency reports.
Earlier this week, the Council of Europe’s Human Rights Commissioner, Nils Muiznieks, said the reforms were “a major setback for judicial independence”.
Meanwhile, Manfred Weber, the leader of the European Parliament’s largest grouping, the EPP, said “Law and Justice is putting an end to the rule of law and leaving the European community of values”.