SANTIAGO (Reuters) - Chilean lithium and fertilizer giant SQM said on Friday it had agreed to pay more than $30 million in penalties to the U.S. Department of Justice and Securities and Exchange Commission to resolve a probe over alleged fake invoices.

It said the DOJ would defer charges relating to internal accounting failures and scrap them after three years if the company agreed to pay $15.5 million and be monitored for two years.

Meanwhile, SQM said it had agreed with the SEC to pay a penalty of $15 million, also over accounting violations.

Authorities had been investigating claims that executives at SQM SQMa.SNSQM_pb.SNSQM.N, one of the world's biggest producers of lithium and iodine, had from 2008 to 2015 illicitly funneled cash into political campaigns via the issue of fake invoices.

The accusations toppled chief executive, Patricio Contesse, and led SQM to introduce measures to tighten corporate governance, as it seeks to reassure investors that include international resources firms such as Canada's Potash Corp POT.TO and China's Tianqi 002466.SZ.

“The SEC has issued a cease and desist order that does not identify any other violations of United States law and in which the SEC notes the fact that the company has taken corrective measures,” SQM said in a statement.

The scandal, which also involved other Chilean companies and lawmakers across the political spectrum, dominated headlines in the country for months.