Demonstrators were treated for injuries after police launched tear gas as part of a crackdown on the rally against laws passed by the Polish government that, critics say, undermine the independence of the country’s judiciary.

Thousands gathered outside Warsaw’s President Palace and across dozens of Polish cities and towns Thursday, to voice their concern against a law that will allow the ruling right-wing Law and Justice party (PiS) to pick Supreme Court judges as well as the heads of local courts, who will then assign cases to judges of their choice, after 22 Supreme Court judges were forced into early retirement.

The amendment, passed by parliament on Wednesday, comes after chief judge Malgorzata Gersdorf refused to take early retirement unlike 22 other judges, saying her constitutional term does not expire until 2020.

Voicing their disdain for new laws, the “Chain of Light” protests saw protesters carry candles and giant novelty pens in reference to Polish President Andrzej Duda’s readiness to sign the bill, which, they claim, will undermine democracy by giving too much power to the government.

Protesters in Warsaw shouted “shame” and chanted "Break the pen" and "You will go to prison," according to a Reuters report.

Witnesses talking to the agency claimed scuffles broke out with police after protesters tried to write slogans on the pavement outside the presidential palace and pepper spray was used as a deterrent.

Blaming a protester for using gas “against police officers”, Warsaw police spokesman Sylwester Marczak said: "Due to the threat, one of the policemen also used a hand-held gas device."

The government, meanwhile, has defended the new measures which they say will eradicate the country’s communist past.

"Without (judiciary) reforms, we cannot rebuild the Polish state so that it serves its citizens," said PiS’s leader, Jaroslaw Kaczynski, according to Reuters.

Since climbing to power in 2015, the eurosceptic PiS has blended social conservatism with economic interventionism but has gained much criticism from human rights groups, opposition parties and the European Commission.

Human Rights Watch has said the government “continues to undermine the rule of law and human rights protection and introduce new laws that curb free expression and assembly.”

In response to Poland’s attack on its judiciary, the EU Court of Justice on Wednesday backed an earlier Irish High Court Justice’s decision to block extradition requests to Poland, after the judge cited fears that citizens would not receive a fair trial.