Brazilian oil company Petrobras has agreed to an $853.2 million settlement with U.S. and Brazilian authorities to end yearslong investigations tied to one of the biggest corruption schemes ever uncovered.

Petróleo Brasileiro SA, as the company is formally known, said Thursday it would pay $682.6 million to a Brazil fund for promoting corporate transparency and compliance and an additional $170.6 million equally split between the U.S. Justice Department and the U.S. Securities and Exchange Commission.

The corruption scandal at the state-controlled oil producer erupted in 2014, when Brazilian prosecutors first announced their investigation into a cartel of construction companies that had been overbilling Petrobras and bribing high-level Brazilian politicians and Petrobras executives along the way.

The investigation, known as Operation Car Wash, has loomed over Petrobras and Brazil ever since. It led to multibillion-dollar losses at the company and slammed its share price, while also sending former Brazilian President Luiz Inácio Lula da Silva and top business executives to jail. The scandal also continues to roil the country’s current presidential election campaign.

Several Petrobras executives directly involved in the corruption have been convicted and jailed, including Paulo Roberto Costa, formerly head of the company’s downstream division, and Nestor Cervero, former director of international operations. A former Petrobras chief executive, Aldemir Bendine, was also convicted of bribery earlier this year, though on charges related to his time as CEO of state-controlled lender Banco do Brasil.