Media playback is unsupported on your device Media caption Poles protest outside parliament in Warsaw

Thousands of Poles have held rallies in the capital Warsaw and other cities to condemn a controversial reform of the judiciary.

Protesters say the bill, passed by the Senate on Saturday, will erode judges' independence and undermine democracy.

It gives MPs and the justice minister the power to appoint judges without consulting judicial circles.

The government says the move is needed because the judiciary is corrupt and serves only the interests of elites.

The bill must still be signed by President Andrzej Duda in order to become law. He has given no indication that he plans to veto it.

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.

How deep is opposition to the reform?

Opposition supporters and human rights activists gathered in Warsaw under Polish and EU flags, and other banners, blowing klaxons, in a demonstration which continued after dark.

Police say about 4,500 people turned out in the capital while another estimate puts the number closer to 10,000. Smaller rallies were held in Krakow, Katowice and elsewhere.

Chats of "shame, shame" and "we will defend democracy" could be heard, correspondents say.

Instead of Law and Justice, one placard in Warsaw read "Lawlessness and Injustice", the BBC's Adam Easton reports from Warsaw.

Image copyright EPA Image caption Grzegorz Schetyna addressed the crowd, with Ryszard Petru at his side

Opposition leaders like former Foreign Minister Grzegorz Schetyna of Civic Platform and Ryszard Petru of the Modern party took to the stage in Warsaw.

"Today we know that a great fight has begun and we know we must be together, we know we must fight against them together," Mr Schetyna told the crowd, Reuters news agency reports.

Image copyright Karolina Stawinska Image caption Thousands tuned out under Polish and EU flags and other banners

The opposition fear the law will give parliament - dominated by PiS lawmakers - indirect control over judicial appointments, violating the constitutional separation of powers.

Włodzimierz Wróbel, a Supreme Court justice, told the BBC Poland would lose its independent judiciary.

Why is the government doing this?

The leader of the PiS, Jaroslaw Kaczynski, says the reforms are needed because the judiciary is corrupt and only serves the elites. His party has previously passed legislation giving it control over the public media and civil service.

Image copyright Reuters Image caption Opponents fear the reform will erode the independence of Poland's judiciary

Justice Minister Zbigniew Ziobro said the current system of appointing judges was undemocratic.

"We want to end corporatism and introduce the oxygen of democracy there," he said. "Because Poland is a democracy based on the rule of law. This is not court-ocracy."

Many Poles agree with the government, our correspondent reports.

Media playback is unsupported on your device Media caption The BBC's Paul Adams examines the political scene in Poland

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 on beforehand and introduced to parliament in the middle of the night, our correspondent says. It is still being discussed.

Under the PiS government, he adds, 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.

How are Poland's EU partners reacting?

The European Commission, which is already investigating Poland for a serious breach of the rule of law, will urgently discuss the developments next week

The Council of Europe's Human Rights Commissioner, Nils Muiznieks, said the reforms were a "major setback for judicial independence".

Manfred Weber, 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."</s>Poland's opposition parties and rights activists are due to stage a protest in the capital Warsaw against the government's reform of the judiciary.

They say the bill, passed by the Senate on Saturday, will erode judges' independence and undermine democracy.

The bill gives MPs and the justice minister the power to appoint judges without consulting judicial circles.

The government says the move is needed because the judiciary is corrupt and serve only the interests of the elites.

The bill must still be signed by President Andrzej Duda in order to become law. He has given no indication that he plans to veto it.

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 judicial reform bill in a vote on Saturday morning after a heated debate.

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.

Many Poles agree with the government, the BBC's Adam Easton in Warsaw reports, but many others say this is not about reform but about political control.

Opposition parties are concerned that the law would give parliament - dominated by PiS lawmakers - an indirect control over judicial appointments, violating the constitutional separation of powers.

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 on beforehand and introduced to parliament in the middle of the night, our correspondent says. It is still being discussed.

Under the PiS government, he adds, 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.

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, 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."</s>Thousands of Poles have gathered outside parliament in Warsaw to condemn political interference in the courts.

They are protesting at a bill to give MPs and the justice minister the power to appoint judges without consulting judicial circles.
Thousands of Poles have held rallies in the capital Warsaw and other cities to condemn a controversial reform of the judiciary. Protestors claim the bill, passed by the Senate on Saturday, will erode judges' independence and undermine democracy.