RIO DE JANEIRO — Leaked private messages among law enforcement officials in Brazil have called into question the integrity of a vast corruption investigation that roiled the country’s political establishment and rippled across much of Latin America.

Excerpts from cellphone chats published Sunday night by the online news site The Intercept suggest that Sérgio Moro, the most prominent judge involved in hearing cases in the scandal known as Lava Jato, or Car Wash, consulted with and advised federal prosecutors on strategy as they took on towering political figures in recent years.

The revelations provide powerful ammunition to critics of Mr. Moro, who convicted former President Luiz Inácio Lula da Silva of corruption and money laundering in 2017, which made him ineligible to run for a new term in last year’s presidential election.

Mr. da Silva’s imprisonment paved the way for the election of Jair Bolsonaro, a far-right politician who appointed Mr. Moro as justice minister and offered to appoint him to the next vacancy on the Supreme Court.