Poland's ruling party has dismissed a growing wave of criticism from key allies and worries at home by approving an overhaul of the Supreme Court that its critics say will undermine judicial independence.
Amid mass protests, senators of the right-wing Law and Justice (PiS) party agreed in the early hours of Saturday to a bill that would remove all Supreme Court justices except those hand-picked by the justice minister.
The overhaul of the judiciary, coupled with the ruling party's drive to expand its powers in other areas, has provoked a crisis in relations with the European Union and sparked one of the biggest political conflicts since Poland overthrew communism in 1989.
Tens of thousands of protesters have gathered across Poland for candle-lit vigils each day since Wednesday, demanding that President Andrzej Duda, an ally of the PiS, veto the bill. More protests were planned for Saturday evening.
The opposition and most legal experts in Poland say the government's overhaul violates the constitution.
But the PiS government has stood firmly by its plan despite accusations that it is heading towards authoritarian rule. The PiS says the changes are needed to ensure courts serve all Poles, not just the "elites".
The European Union's executive on Wednesday gave Poland a week to shelve the judicial reforms that Brussels says would put courts under direct government control, or risk sanctions.
"Today the strategic direction towards the West that we had chosen is being reversed," European Council President and former Polish premier Donald Tusk told TVN24 television on Friday.
The US, Poland's most important ally in NATO, called on Warsaw to make sure that any changes respect the constitution.
"We urge all sides to ensure that any judicial reform does not violate Poland's constitution ... and respects the principles of judicial independence and separation of powers," it said in a statement.
Mr Duda's spokesperson said on Saturday the president believed there was an inconsistency in the bill, but stopped short of saying what Mr Duda would do.