WARSAW (Reuters) - The upper chamber of Poland’s parliament has approved an amendment smoothing the way for the ruling party to name the next chief of the Supreme Court, despite street protests and objections from opposition parties.

Slideshow ( 8 images )

The European Union, human rights groups and the opposition have all accused the government of infringing judicial independence, but the ruling nationalist Law and Justice (PiS) party says an overhaul is needed to boost the courts’ efficiency and eradicate the residual influence of the communist past.

Hundreds of people protested in many Polish cities on Tuesday night, although the numbers were sharply lower than the tens of thousands who turned out last summer to demonstrate against the government, which came to power three years ago.

Polish news agency PAP quoted opposition party lawmakers as saying the upper house, or the Senate, adopted the late night changes in violation of house rules, as the speaker did not allow for more discussion on the amendment.

This month 22 Supreme Court judges were forced into early retirement but chief Judge Malgorzata Gersdorf has refused to go, saying her constitutional term expires in 2020. She has become a symbol of resistance to the judicial revamp.

Since the PiS won power, dozens of judges have been dismissed from the Constitutional Tribunal, the National Judiciary Council, which decides judicial appointments, and now the Supreme Court.

New appointments have employed procedures that give parliament, where the PiS has a majority, greater say over the courts and the government more control over judges.

The European Commission is running an unprecedented rule of law investigation and has opened several separate legal cases against Poland, the largest former communist EU state, including some over the Supreme Court.

Warsaw risks losing billions of euros in European aid if it is found to be subverting the rule of law.

Prime Minister Mateusz Morawiecki said last week Gersdorf had to be replaced quickly to avoid legal chaos and that Poland would not heed demands by Brussels to reverse its judicial laws.

The most recent changes adopted by parliament will have to be signed into law by President Andrzej Duda, a PiS ally.