Several thousand people have rallied in Warsaw, Poland, to protest against controversial new court reforms they see as a threat to judicial independence.

Police said around 4,500 people attended the demonstration on Sunday in front of the Polish parliament, which this week passed legislation that critics say gives the ruling Law and Justice (PiS) party power over the courts.

Poles chanted "we will defend democracy" in the latest string of mass anti-government demonstrations that have characterised the conservative party's 20 months in power.

The demonstration was organised by the KOD pro-democracy movement, which is critical of the governing conservatives' policies on courts as well as other areas such as media and education.

READ MORE: The complex story of Polish refugees in Iran

Their main theme has been the defence of democracy under the ruling party, which controls both houses of parliament. The fractured and weak opposition has posed little threat to the government, other than participating in the protests.

"We, the citizens, are defending the rule of law, we are on the side of the law," said one of the protest leaders, Wladyslaw Frasyniuk, a top pro-democracy activist in the 1980s.

"This whole set of (judicial) bills is a scandal," said protester Agnieszka Janczarska, a 39-year-old lawyer in Warsaw.

"It's a destruction of the fundamental principles of a democratic state, namely the separation of powers," she told AFP.

The two main opposition leaders, Grzegorz Schetyna from Civic Platform (PO) and Ryszard Petru from the Modern party, were at the rally and said they would join forces to fight against the reforms.

READ MORE - Poland: Anti-government rally draws tens of thousands

Earlier this week Poland's parliament adopted a bill that gives the minister of justice the power to name the chief justices of the EU member's common courts.

Legislators also passed a second bill that empowers the parliament - which is controlled by the conservative PiS party - to choose the members of the National Council of the Judiciary (KRS), whose role is to protect the independence of the courts.

The PiS also tabled a separate bill in parliament on Thursday that would subjugate the supreme court - which supervises lower courts - to executive power, in a move the opposition slammed as "the announcement of a coup".

Under the proposed bill, the current supreme court justices will be forced to retire, except those named by the justice minister, who would also be responsible for selecting candidates to succeed the retired judges.

The PiS-led government has already run afoul of the European Commission and critics at home for implementing reforms of the constitutional court, whose main role is to check that laws comply with the constitution.

Poland is still a young democracy, having shed communist rule in 1989 and joined the European Union in 2004.