The ruling Law and Justice party says changes are needed to make courts more accountable but critics dub the move as unconstitutional.
Poland's senate approved a controversial reform of the Supreme Court early on Saturday, despite warnings from the European Union, appeals from Washington and massive street protests against the measure.
The parliament's upper house was expected to vote through during the night a bill forcing the removal of all Supreme Court judges except for those selected by the justice minister and approved by the president.
Since Thursday, tens of thousands have protested in Warsaw, Poznan, Krakow and other Polish cities in one of the biggest demonstrations since the 2015 election. Some protesters carried Polish and European Union flags chanting "Free Courts".
EU, US express concern
Poland's Supreme Court, its former presidents, the ombudsman, the Polish associations of judges have all denounced the bill as unconstitutional. The head of the European Parliament and president of the European Council expressed concern the bill would erode the independence of courts.
The United States, Poland's most important ally in NATO, issued a statement urging Poland to ensure any changes respect the constitution.
"We urge all sides to ensure that any judicial reform does not violate Poland's constitution or international legal obligations and respects the principles of judicial independence and separation of powers," it said in a statement.
An opinion poll for private television TVN showed on Friday that 55 percent of respondents said President Andrzej Duda should veto the overhaul of the judiciary, 29 percent said he should not veto it.
The government of the EU's biggest eastern member state has so far dismissed criticism, saying the changes were needed to make courts more accountable and to ensure state institutions serve all Poles, not just "elites".
Senator Aleksander Bobko, of the right-wing PiS party, said that ending the term of the first Supreme Court president was an obvious violation of the constitution.
"The constitution is so simple and clear here that even my granddaughter would be able to read and understand it," he told local media.
According to the constitution, the country's president appoints the first Supreme Court president for a six-year term. The current term ends in 2020.
The ruling Law and Justice party (PiS) has rushed through its systemic overhaul of the top court. The bill was not subject to any public consultation and was passed by the lower chamber just nine days after it was first submitted.
On Wednesday, the EU gave Poland a week to shelve the judicial reforms that Brussels says would put courts under direct government control. If the PiS government does not back down,Poland could face fines and even a suspension of its voting rights, although other eurosceptic EU governments, notably Hungary, are likely to veto strict punishments.
Senior Czech judges denounced the judicial overhaul in Poland as an attack on the rule of law on Friday.
The PiS has offered some concessions on demand from the president, but has presented criticism from abroad as unacceptable meddling in the domestic affairs of the country, which overthrew communism in 1989 and joined the EU in 2004.
"We will not give into pressure. We will not be intimidated by Polish and foreign defenders of the interests of the elite," the prime minister said in an address on state television.
Since being elected in 2015, PiS has sought to tighten government control over the courts, brought prosecutors and state media under direct government control. It has also introduced restrictions on public gatherings and made it harder for some non-governmental organisations to function.
Opposition groups and other critics have said the legislation is part of a power grab by the ruling Law and Justice (PiS) party that would undermine the EU's liberal principles.
"We believe that Poland is slowly but systematically turning into a penal institution," opposition senator Jan Rulewski, a veteran activist of the anti-communism movement, said during the debate, dressed in prison uniform.
Increased social spending, record low unemployment and robust economic growth have so far kept the PiS government popular despite the protests over some of its changes.
Once the legislation passes in the Senate, where PiS has a majority, the bill will go to President Duda, a PiS ally, for final approval.
While Polish assets have been largely unfazed by the political turmoil earlier this week, the zloty fell over 1 percent against the euro on Friday, underperforming all of the region's other currencies.