Two major Brazilian companies were hit with a record $3.5 billion in criminal fines Wednesday in what authorities say is the largest foreign bribery case in history.

One of the firms, Odebrecht, a global construction company, played a key role in the corruption scandal that's sparked Brazil's worst recession ever and engulfed its politicians, including the last two presidents.

The fines, announced by the U.S. Attorney's office in Brooklyn, N.Y., resolve charges that were levied in the United States, Brazil and Switzerland against Odebrecht and Braskem, a Brazilian petrochemical firm.

"Odebrecht and Braskem used a hidden but fully functioning Odebrecht business unit - a 'Department of Bribery,' so to speak - that systematically paid hundreds of millions of dollars to corrupt government officials in countries on three continents," said Deputy Assistant Attorney General Sung-Hee Suh.

Related: Brazil hit by more punches amid historic recession

The companies are not charged with bribing any U.S. officials, but the since the scheme used U.S. bank accounts, they are being charged in federal court in the U.S. The U.S. Attorney in Brooklyn was also responsible for bringing bribery charges in 2015 against some of the top officials of FIFA, the governing body for international soccer.

The record fine is the latest twist in Brazil's corruption scandal. Its state-run oil company, Petrobras, operated a deep bribery ring between construction firms including Odebrecht and Brazilian politicians.

Brazil's former president, Luiz Inacio Lula da Silva, was indicted Monday by a federal judge in Brazil on charges of alleged money laundering and corruption. Known as "Lula," he is accused of accepting a penthouse apartment paid for by Odebrecht in exchange for contracts with Petrobras. He's implicated in at least three other corruption cases.

Lula's successor, Dilma Rousseff, was impeached earlier this year. Although she was formally accused of another crime, the Petrobras scandal and the recession it helped create loomed over her impeachment trial.

Rousseff wasn't accused of accepting bribes from Odebrecht, but many in her inner circle have been jailed on accusations they accepted bribes from Odebrecht and other firms.

Even four cabinet members of the current president, Michel Temer, have had to resign after corruption allegations tied to the bribery ring.

U.S. officials said foreign bribery poses a major risk to America.

"When foreign officials receive bribes, they threaten our national security and the international free market system in which we trade," said FBI Assistant Director in Charge William Sweeney. "Just because they're out of our sight, doesn't mean they're beyond our reach."

U.S. and Swiss authorities will each get 10% of the fine money, while Brazil will receive the other 80%. Braskem (BAK) will pay about $950 million. Odebrecht will pay at least $2.6 billion and as much as $4.5 billion, depending up what an independent analysis finds the company can afford.