In a rally at the Presidential Palace, demonstrators wielded Polish and European Union flags, held posters saying "constitution" and "I love and understand freedom," and shouted "we want a veto," "free court" and "free Poland."
After the throng dispersed, many continued their protests at other locations, in front of the High Court and at the Sejm, Poland's lower house of parliament.
Critics have slammed the legislation's passage as a blatant power grab by President Andrzej Duda and his right-wing Law and Justice Party (PiS), but the party insists it is simply carrying out needed judicial reform.
Key to the legislation is that current Supreme Court judges would be forced into early retirement and new judges would be appointed by the Justice Ministry.
The President has 21 days to sign or veto the legislation. He is widely expected to approve it, but protesters are calling on him to reject it.
Parliament's upper house, the Senate, approved the bill just before 2 a.m. on Saturday
after 16 hours of debate, sparking mass protests in more than 100 cities across the country and a wave of condemnation from abroad. The lower house
voted for the measure on Thursday.
The move to control one of the last remaining independent government institutions has prompted concern in Washington and triggered warnings from the European Union that it is putting judicial independence at risk.
The bill's passage could mark a turning point for the Eastern European country, one of the first former communist nations to join the European Union.
A poll conducted by CNN affiliate TVN
found that 55% of Poles said Duda should veto the court laws; 29% said he should not.
Clock starts ticking
Adam Bodnar, Poland's human rights ombudsman, described the law as the most important decision of Duda's term.
He and other critics of the bill admit the judiciary needs reform but disagree about the way in which the PiS has gone about it.
"It is a situation (where) you should repair your house, mend windows, paint walls, seal the leaking roof," said Bodnar. "But you should not put explosives under foundations of the house."
Since coming to power, the Law and Justice party has eroded other institutions and freedoms: The right to peaceful assembly has become more restricted, and new media laws have made it more difficult for the press to operate independently.
'Dangerous consequences,' EU warns
A top EU official earlier this week threatened the use of Article 7, a mechanism that would allow for sanctions against Poland and possible suspension of its voting rights in the bloc. The measure has never been used before.
"Each individual law, if adopted, would seriously erode the independence of the Polish judiciary," said Frans Timmermans, first vice president of the European Commission. "Collectively, they would abolish any remaining judicial independence and put the judiciary under full political control of the government."
European Council President Donald Tusk, a former Polish Prime Minister from the opposition Civic Platform Party, warned Thursday of "dangerous consequences" for Poland's standing on the world stage and said he had asked Duda for an urgent meeting.
"Bringing the courts under the control of the governing party in the manner proposed by the Law and Justice Party ... will ruin the already tarnished public opinion about Polish democracy," he said.
A Trump effect?
The public outcry over efforts to curtail judiciary independence has flown largely under the radar amid recent high-profile visits
to Poland by US President Donald Trump
and the British royals.