Prosecutors in Brazil have threatened to quit over alleged intimidation by members of the graft-plagued Congress.
Deltan Dallagnol, coordinator of the so-called "Operation Car Wash" probe into a gigantic embezzlement and bribery scheme centered on state oil company Petrobras, said that a bill passed in the lower house in the early hours of Wednesday amounted to an attack on the judiciary.
"The lower house signaled the end of Car Wash," he said in a press conference alongside other prosecutors who threatened to resign if the bill was not vetoed by President Michel Temer.
The controversial law is ostensibly meant to crack down on undeclared election campaign funds, a common practice in Brazilian politics that has been linked to large-scale corruption.
However, lower house deputies also inserted measures opening the way to prosecute judges for abuse of authority. Judges and prosecutors have branded this as a weapon to reduce the judiciary's independence.
"It would not be possible to keep working on Car Wash if this intimidatory law were approved," Dallagnol said.
"Our proposal is to resign collectively if this bill is approved by the president," prosecutor Carlos dos Santos Lima said.
The probe has uncovered multi-billion-dollar embezzlement and bribery involving Petrobras, Brazil's biggest construction companies like Odebrecht, and a host of political parties.
High-ranking figures including former president Luiz Inacio Lula da Silva and some of Brazil's richest men face charges or have already been convicted.
Dozens of members of Congress have also come into prosecutors' crosshairs.
Now with executives from Odebrecht striking cooperation agreements with prosecutors, there are expectations of a wave of new politicians being investigated.
The anti-corruption drive is popular with Brazilians enraged at the constant scandals in the capital Brasilia where dozens of senators and deputies have had brushes with the law or currently face charges for corruption or other crimes.
The law approved by the lower house was meant to address that public anger by closing a gaping loophole in illegal campaign financing -- what had effectively been a green light for politicians to take bribe money.
However, well after midnight, deputies weakened the text and inserted the explosive amendment that the judiciary is calling an attack on its ranks.
They did this while the attention of journalists and the public were fixed on the air disaster that killed much of Brazil's Chapecoense football team, and on violent protests against austerity measures voted on earlier in the Senate.
The lower house had already been under intense scrutiny for an attempt last week to change the text of the law to include what amounted to an amnesty for politicians who had already received dirty money.
Amid a public outcry, Temer went on television to promise to veto such an amendment. That measure was dropped but the one targeting the judiciary could turn out to be just as incendiary.
Temer's government, which came into power after the impeachment of leftist president Dilma Rousseff this year, has vowed to restore Brazil's economic health and political stability.
However, he faces mounting crises and a badly ailing economy, along with popular opposition to his proposed austerity reforms. On Tuesday, crowds fought violent battles with riot police outside the Senate as legislators approved a budget freeze.