BRASILIA/SAO PAULO (Reuters) - J&F Investimentos, controlling shareholder of the world's largest meatpacker JBS SA (>> JBS SA), agreed to pay a record-setting 10.3 billion real ($3.2 billion) fine for its role in corruption scandals that threaten to topple President Michel Temer.

The settlement meant Brazil's sweeping graft investigations have now led to the world's two biggest leniency fines ever levied, Brazilian prosecutors said.

J&F's penalty surpassed the 8.5 billion reais Brazilian construction firm Odebrecht agreed to pay for its role in the political graft scandal convulsing Latin America's biggest economy.

"The payments will be made exclusively by the holding company and should start in December 2017," prosecutors said in a statement late Tuesday, adding that J&F would have 25 years to make the payments. The installments will be adjusted based on the benchmark IPCA consumer price index.

The settlement follows testimony from J&F's owners Joesley and Wesley Batista that they spent 600 million reais to bribe nearly 1,900 politicians in recent years, revelations that have deepened Brazil's political crisis.

J&F was able to reduce the final value of its fine by 900 million reais from an initial 11.2 billion reais proposed by Brazilian prosecutors. J&F's three previous proposals were rejected and the company replaced its lawyers earlier on Tuesday.

J&F confirmed the terms of the leniency agreement and said in an emailed statement that the fine was being paid by the holding company, to protect JBS' minority shareholders.

In a securities filing, JBS said the fines settle charges of two corruption probes involving the company. In a statement, JBS chairman Tarek Farahat said the agreement removes risk to JBS investors, employees and clients.

Joesley Batista is at the center of a corruption investigation into Temer, after secretly recording a conversation in which the president appeared to condone bribing a potential witness. Other JBS executives in plea-bargain testimony accused Temer of taking nearly $5 million in bribes from the company in recent years.

The JBS testimony was the most damaging yet to Brazil's political class, hitting virtually all major figures past and present. It included allegations that former presidents Luiz Inacio Lula da Silva and Dilma Rousseff received $80 million in bribes in offshore accounts.

Rousseff was impeached last year on breaking budgetary laws and Temer, her vice president, took over. Temer, Lula and Rousseff have all denied wrongdoing, with Temer defiantly rebuffing calls to resign.

Joesley Batista resigned last week as chairman of JBS and left the board. His brother Wesley resigned as vice chairman of the JBS board though he retained a board seat and is still the firm's chief executive officer.

FALLING FORTUNES

JBS shares have slid more than 28 percent this month in extremely turbulent trading because of concern that blowback from the scandal could limit its funding options.

Common shares in JBS rose up to 8 percent on Wednesday, to 8 reais, as investors bet the meatpacker might be forced to hand out extra dividends to help its controlling shareholder pay the fine.

Traders warned, however, that the stock is likely to remain volatile as further probes involving tax issues, suspected irregularities on past acquisitions and financial market transactions develop.

Most of the fine J&F will pay, or 8 billion reais, will be divided among Brazil's development bank BNDES, FGTS workers' severance fund, two pension funds for employees of state-controlled companies and lender Caixa Econômica Federal.

Pension funds and state-run banks invested in or extended loans to J&F companies in return for bribes paid by the Batista brothers, according to plea-deal testimony.

Prosecutors said in the statement the fine is equivalent to 5.6 percent of group revenue. Investors in JBS shares had been closely watching the plea negotiations.

(Reporting by Ricardo Brito in Brasilia and Tatiana Bautzer in Sao Paulo; Additional reporting by Brad Brooks and Bruno Federowski in Sao Paulo; Editing by Marguerita Choy and Andrew Hay)

By Ricardo Brito and Tatiana Bautzer

Stocks treated in this article : Petroleo Brasileiro SA Petrobras, JBS SA