BRASILIA (Reuters) - Brazil’s Supreme Court ruled on Thursday it has the right to reject plea bargains made in corruption probes, potentially undercutting investigations that have threatened President Michel Temer’s government, prosecutors said. A majority of the court said plea bargains, such as those made by dozens of executives at the world’s largest meatpacker JBS SA and construction firm Odebrecht [ODBES.UL], could be evaluated by the full court and rejected if they rule that a state’s witness lied or withheld information. However, the court ruled that it did not have the right to change the benefits that prosecutors give a person who turns state’s witness.

Brazilian President Michel Temer attends a ceremony of the 152nd anniversary of the Riachuelo Naval Battle at the Marine Corps Headquarters in Brasilia, Brazil June 9, 2017. REUTERS/Ueslei Marcelino

That move would have killed the entire plea bargain process, which has been a key tool in uncovering massive graft schemes in recent years, prosecutors told Reuters.

“The full court cannot change the terms of a plea bargain if all its terms were met,” said Justice Luiz Fux. “Once the plea bargain has been approved by prosecutors, the only thing that can be analyzed is if there was full collaboration.”

Three federal prosecutors directly involved in the biggest of the graft investigations told Reuters that their main fear was that the court might have ruled it could change the benefits given to state’s witnesses. That, one prosecutor said, would have been “a signal to those who may wish to strike an accord with prosecutors and turn over substantial amounts of proof of corruption that they may not really benefit from doing so.” While the court stopped short of that, investigators fear that involving all 11 top court justices in deciding whether or not a state’s witness has fully collaborated could still spook some potential witnesses into not talking. Eloisa Machado, a law professor at the elite FGV university in Sao Paulo, said Thursday’s ruling was still positive, however, since it signaled the continuation of Brazil’s various corruption investigations.

That was especially true, according to Machado, of the “Operation Car Wash” probe that has uncovered billions of dollars in bribes paid by big firms like JBS and Odebrecht, money that was funneled to politicians and executives at state-run companies in return for lucrative contracts. The anti-graft push has put Temer, four past presidents, and dozens of lawmakers under investigation and led to the conviction of over 90 powerful politicians and businessmen.

“With the ruling, the Supreme Court guaranteed the integrity of Operation Car Wash and the chance that other mega cases of corruption and organized crime will be discovered,” said Machado.

Brazil only began allowing plea-bargain agreements in 2013. Scores have been struck, notably that of 77 Odebrecht executives and seven businessmen from JBS.

It was testimony in the JBS case that earlier prompted the Supreme Court to authorize an investigation into allegations that Temer took millions of dollars in bribes to help the meatpacker.

The conservative leader, who replaced impeached President Dilma Rousseff just over a year ago, has denied any wrongdoing and accused a leading witness against him of lying.

Plea-bargain testimonies have shaken Brazil’s political and business sectors to their core as they revealed the corrosive effects of graft on Latin America’s biggest economy.

Joesley and Wesley Batista, the brothers who control JBS, managed to avoid serving any jail time as part of their plea-bargain deal, though they had to pay a total of 225 million reais ($67.4 mln) in fines. The Batistas and other JBS executives managed to stun a nation accustomed to the corruption revelations when they testified they had spent roughly 500 million reais in recent years to bribe nearly 1,900 politicians at all levels of government.