Several hundred people protested outside the Polish parliament on Tuesday against planned legal amendments aimed at making it easier for the ruling party to name the next Supreme Court head.
The European Union, human rights groups and opposition have all accused the government of infringing judicial independence, but the ruling nationalist Law and Justice (PiS) party says an overhaul is needed to improve the courts' efficiency and rid them of residual influence from Poland's communist past.
The upper chamber of parliament is expected to approve the amendments on Tuesday evening with President Andrzej Duda, a PiS ally, then signing them into law.
However, the numbers of protesters were sharply lower than the tens of thousands who joined demonstrations last summer against the PiS government, which came to power three years ago.
This month 22 Supreme Court judges were forced into early retirement but Chief Justice Malgorzata Gersdorf has refused to go, saying her constitutional term expires in 2020. She has become a symbol of resistance to the judicial revamp.
Gersdorf accepted on Tuesday the judiciary requires "real modernization". However, she said that for almost three years it had been "subject to personnel changes aimed by the governing majority at obtaining influence over the courts' actions".
This "exceeds the borders designated in the constitution", she added in a statement in which we thanked the protestors.
Since the PiS won power in 2015, dozens of judges have been dismissed from the Constitutional Tribunal, the National Judiciary Council - which decides judicial appointments - and now the Supreme Court.
New appointments have been made using procedures giving parliament, where the PiS holds a majority, more say over the courts and the government more control over judges.
The European Commission is running an unprecedented rule of law investigation and has opened several separate legal cases against Poland, the largest former communist EU state, including over the Supreme Court.
Warsaw risks losing billions of euros in European aid if it is found to be subverting the rule of law.
Prime Minister Mateusz Morawiecki said last week Gersdorf had to be replaced quickly to avoid legal chaos and that Poland would not heed demands by Brussels to reverse its judicial laws.
At Tuesday's rally, some protesters drew pavement pictures of a duck, the nickname of PiS leader Jaroslaw Kaczynski. Police officers asked them to produce their identity documents, writing down the details.