BRASILIA/SAO PAULO (Reuters) - Brazilian Senators, two dozen of whom are being investigated for corruption, pushed through a bill on Wednesday that many prosecutors and judges say curbs their ability to carry out probes, mainly those targeting the politicians themselves.

General view of Brazil's Senate during a session of voting on a constitutional amendment, known as PEC 55, that limits public spending, in Brasilia, Brazil December 13, 2016. REUTERS/Adriano Machado

The scandal-plagued Senate voted 54-19 to approve the measure that punishes public servants and members of the government, legislature and judiciary for so-called “abuse of power.”

Prosecutors could be punished with up to six months’ suspension for collecting evidence illegally, such as wiretaps or violation of bank secrecy rules without judicial authorization, or of simply showing impartiality against those they investigate.

The Senate voted two weeks after the Supreme Court opened investigations into 98 politicians for receiving bribes and political kickbacks in Brazil’s biggest corruption scandal involving billions of dollars in bribes connected to projects at state-run oil company Petrobras during the past 15 years.

At least 24 senators are under investigation in the “Car Wash” case.

The bill, which is expected to clear the lower house with equal haste, was sharply criticized by one of the main federal prosecutors in the Petrobras case.

“This is a shameful move by the Senate. This is means the slow destruction of a serious corruption investigation,” said prosecutor Carlos Lima.

“Unfortunately, they believe Brazilians have been anaesthetized by so much corruption and don’t care. I hope people are angered by this and redouble their support for the investigations.”

Yet last-minute changes were made Wednesday to the Senate version of the bill, narrowing its scope.

Federal judge Sergio Moro, who has found over 80 people guilty in the Petrobras probe and is the leading figure of the fight against graft in Brazil, said that what passed was far better than what was originally proposed.

“The alterations made today in the senate represent a victory for the moderate parliamentarians and deserve praise,” Moro said. “There are still points to criticize in the approved text, but some of the more serious fears have been removed.”

Moro is currently conducting the highest-profile trial yet in the case, that of ex-President Luiz Inacio Lula da Silva, leader of the Workers Party (PT), whose legal team has repeatedly accused Moro of personally persecuting Silva.

“Lula has not given any proof that Moro hates him or is personally persecuting him, but his team will certainly try to prove it,” said Sergio Praca, a political scientist at the Getulio Vargas Foundation, a leading Brazilian University.

“But I don’t see any smoking gun there that Sergio Moro is anti-PT. He’s found guilty politicians of various parties, not just the PT.”

The Senate also passed on Wednesday a bill long sought by prosecutors - a measure to end a legal protection enjoyed by government ministers and elected politicians, who can only be tried by the badly backlogged Supreme Court, which can take several years to hear cases.

Leftist Senator Randolfe Rodrigues, author of the bill, said all the Car Wash corruption cases before the Supreme Court would immediately be sent down to a lower court and would be handled by Judge Moro if the bill became law.

But it’s uncertain if the lower house, which also has several members facing corruption investigations, would pass the measure. It must go through another vote in the Senate and then two more votes in the House before becoming law.