SÃO PAULO—The chairman of meatpacking giant JBS SA has told prosecutors he made millions of dollars of illegal payments to President Michel Temer and his predecessors, Dilma Rousseff and Luiz Inácio Lula da Silva.

The revelations, in documents released by the country’s Supreme Court, came a day after the court said Mr. Temer was being formally investigated for corruption and obstruction of justice.

Joesley Batista, whose company is one of Brazil’s biggest, said in a plea deal with prosecutors that Mr. Temer asked for money on multiple occasions in amounts that added up to at least 7 million reais ($2.2 million), and that some of the money was intended to be used for political campaigns. Mr. Batista told prosecutors he met with Mr. Temer at least 20 times after they first became acquainted in 2010.

Mr. Batista also said he deposited $30 million in an offshore bank account for Ms. Rousseff, in exchange for loans from the state development bank, BNDES, to a company controlled by the Batista family’s holding company. It wasn’t clear what the money was intended for.

He also told prosecutors he put at least $50 million into an offshore account held by Mr. da Silva. He said Ms. Rousseff and Mr. da Silva had $150 million in offshore accounts in 2014.

Mr. da Silva’s lawyer denied any wrongdoing on the former president’s part. Representatives of Mr. Temer and Ms. Rousseff had no immediate comment. They have denied wrongdoing in the past.

Write to Jeffrey T. Lewis at jeffrey.lewis and Luciana Magalhaes at Luciana.Magalhaes