By Pawel Sobczak and Marcin Goclowski

WARSAW (Reuters) - Poland's parliament put on hold for several hours until 0900 a.m. local time on Wednesday a debate over the bill giving itself the power to appoint Supreme Court judges, amid opposition's criticism that the law would politicize the judiciary.

Lawmakers from the ruling nationalist Law and Justice (PiS) party and their coalition partners passed the bill in its first reading and moved immediately to the second and final reading, amid frequent opposition cries of "Shame!" and "Cowards!".

Opposition deputies vowed to extend the all-day debate as long as possible into the night to delay the bill's passage into law. They submitted number of amendments to the bill in order to achieve this.

But the debate almost moved out of control when PiS president Jaroslaw Kaczynski told the opposition: "I know you're afraid of truth, but do not wipe away your treacherous muzzles with my brother's name."

Kaczynski's twin-brother Lech died in a jet crash in Russia, along with 95 other passengers of the plane, mainly high-ranked Polish officials in 2010.

Finally the debate was put on hold.

"I propose to direct the bill to the justice and human rights panel. ... I order a break until tomorrow, July 19, 0900," lower house of parliament (Sejm) Deputy Speaker Joachim Brudzinski said.

Since winning an election in 2015, PiS has sought to increase the government's influence over courts and prosecutors as well as state media, prompting the European Union to launch a review of the rule of law in one of its newest members.

PiS says the judicial reform is needed to make the courts accountable and ensure that state institutions serve all Poles, not just the "elites" that it portrays as the support base for the opposition.

"PiS ... will carry out this reform to the end," Prime Minister Beata Szydlo told the assembly.

Opposition parties say the bill violates the constitutional separation of powers and could potentially give the ruling party influence over election results through the Supreme Court that validates them - charges that PiS rejects.

President Andrzej Duda, who is backed by PiS and usually supports its legislation, said Poles were "not satisfied with how the justice system functions".

But he threw up a surprise obstacle by saying he would not sign the bill into law unless parliament agreed to increase the majority needed to appoint the panel that would pick future judges.

The bill, which also needs the approval of the upper house, where PiS also has a majority, will retire all the Supreme Court judges unless they get the approval of a judicial appointments panel whose members will mostly be nominated by parliament.

PEACEFUL PROTEST

Last Friday, parliament passed a law ending the terms of current members of the panel, the National Council of the Judiciary (KRS), and giving parliament the power to choose 15 of its 25 members.

But Duda on Tuesday insisted that appointments of judges to the KRS should require a three-fifths majority in parliament, a condition that would make a bit more difficult for PiS and its partners to push through appointments to the panel on their own.

Opposition parties say shortening the judges' terms is unconstitutional.

"If the president seriously wanted to stop what's going on, he should veto (all) the bills," said Borys Budka, deputy leader of the main opposition party, Civic Platform (PO).

Several thousand people gathered in front of the presidential palace in a peaceful protest against the reforms, holding candles in their hands before they moved to the parliament.

The parliament building had been cordoned off with barriers and guards since Sunday, when thousands protested against the Supreme Court legislation in Warsaw and other cities.

The tensions have echoes of a standoff in December when opposition leaders blocked the podium of the debating chamber for a month ahead of a budget vote, after objecting to PiS plans to curb media access to parliament.

The European Commission, the EU's executive, was due to discuss the judicial bills in Brussels on Wednesday, having expressed concerns for months about the direction of reforms in Poland.

The separation of powers between executive and judiciary is a fundamental democratic principle for the EU, but in many member states the effectiveness of separation can be as much a matter of political culture as of formal structures.

The PiS government remains broadly popular, benefiting from record-low unemployment, a robust economy and increased social welfare spending.

(Additional reporting by Karol Witenberg; Writing by Lidia Kelly and Justyna Pawlak; additional reporting in Brussels by Gabriela Baczynska; Editing by Kevin Liffey)