Poland's Senate has ignored the angry voices on the street and edged closer toward a showdown with the European Union by approving new measures that critics fear will put the Supreme Court under the control of the ruling Law and Justice (PiS) party.

After 15 hours of debate that lasted until the early hours of Saturday morning, 55 senators voted in favor of the reforms, which effectively grant lawmakers the power to appoint and fire Supreme Court judges.

Read more: 'Somebody has stolen Poland and its values'

Twenty-three members of the upper house voted against, while two abstained. The vote follows one on Wednesday that saw the lower house also approve the PiS bill.

For the bill to become law, Polish President Andrzej Duda must decide within 21 days whether to sign it, veto it or hand it to the constitutional court to rule on - the very court affected by the measures. The president, however, is himself a member of the conservative PiS, making it very likely that he will ultimately put his signature to the legislation.

Duda, however, has agreed to discuss the bill with Poland's top judge, Malgorzata Gersdorf, on Monday before making a decision.

What does the bill do?

The new judicial reforms would effectively place Poland's Supreme Court under political control. Lawmakers will be able to retire and appoint judges as they see fit.

Indeed, the bill in its current form already calls for the firing of all Supreme Court judges, bar those already appointed by Poland's PiS justice minister, Zbigniew Ziobro. Until now, judges have been selected by an independent committee which includes a handful of politicians.

Read more: Polish court reforms: What Jaroslaw Kaczynski actually proposes

It also gives the president the power to impose regulations on the court's work and the cases it should handle, while also creating a chamber overseen by the justice minister that would handle suspected breaches of regulations and ethics.

Critics maintain that the legislation amounts to a "coup d'etat" that extinguishes Poland's judicial independence. One of the greatest fears is that a subservient court could choose to invalidate a future election result.

Meanwhile, PiS head Jaroslaw Kaczynski has argued that the "radical changes" are necessary to transform Poland's justice system, which, he claims, still works according to a communist-era model.

Huge crowds in the city of Wroclaw make their voices heard, urging President Duda to scrap the proposed judicial measures.

Critics at home and abroad

As the first reports broke early on Saturday morning that the Polish Senate had voted to pass the bill, protesters gathered before the parliament, shouting "Shame!" "Traitors!" and "Democracy!"

Earlier that day, as the upper house was still debating, tens of thousands gathered before the presidential palace, urging Duda to reject the reforms and chanting "free European Poland" and "We want a veto."

Poland's neighbors, including Germany, have voiced their fears over the contested judicial reforms. Jens Gnisa, chairman of the German Association of Judges, told broadcaster RNZ that Poland was moving towards a "politically controlled judiciary, in which compliant judges are guided like puppets."

In Brussels, the European Commission has threatened to trigger Article 7, a sanction law intended to deter "serious and persistent violations" of the EU treaty's fundamental values. Should it pass, Poland would see it voting rights as an EU member state suspended.

Watch video 01:04 Share Thousands protest in Poland Send Facebook google+ Whatsapp Tumblr linkedin stumble Digg reddit Newsvine Permalink https://p.dw.com/p/2gzct Poland: Fear for democracy rises

Hungary pledges its support

Meanwhile, Hungary on Saturday signaled that it intends to defend Poland from the European "inquisition."

Read more: European Commission takes on Hungary over 'Soros laws'

During a speech in Romania, Hungarian Prime Minister Viktor Orban said that "the inquisition offensive against Poland can never succeed because Hungary will use all legal options in the European Union to show solidarity with the Poles."

Like Kaczynski, Orban has also presented himself as a freedom fighter against EU's suspected overreach. His government, meanwhile, has faced repeatedly drawn ire from Brussels for allegedly overlooking fundamental democratic freedoms.

dm/aw (AFP, AP, dpa)