BRASILIA (Reuters) - Brazil’s Supreme Court ruled on Thursday that it has the right to reject plea bargains made in corruption probes, potentially undercutting investigations that have threatened President Michel Temer’s government.

A majority of the court said plea bargains could be rejected if a state witness was found to have lied or withheld information.

The court also debated whether it had the right to change the terms of deals handed out to state’s witnesses, but ultimately ruled it did not. That move would have effectively killed the entire plea bargain process that has only been legal in Brazil since 2013, prosecutors said.