RIO DE JANEIRO — President Jair Bolsonaro’s cellphones were among hundreds targeted by hackers this year, he said Thursday, as part of an elaborate scheme that has roiled the political establishment and called into question the fairness of high-profile corruption prosecutions.
The revelation came days after law enforcement officials took four people into custody as part of their investigation into the hacking of confidential material stored on the cellphones of Brazilian cabinet members, prosecutors and lawmakers.
Mr. Bolsonaro called the hacking “a serious attack against Brazil and its institutions,” but said he personally had little to fear. “I never handled sensitive or national security matters over a cellphone,” he said.
On Thursday, Brazilian newspapers reported that one of the suspects, Walter Delgatti Neto, told investigators that he had leaked correspondence between prosecutors and a prominent judge to The Intercept, an online news site, which published several articles based on the material.
The hacking scheme, investigators said, started when Mr. Delgatti targeted a prosecutor who had once charged him with drug trafficking, and then grew to compromise the phones of other officials.
Mr. Delgatti was said to have told investigators that he leaked material to The Intercept voluntarily and without seeking compensation because he disagreed with the conduct of prominent figures carrying out the wide-scale corruption investigation known as Car Wash. That inquiry has entangled top political and business figures in Brazil and throughout the region over the past five years.
Some of the leaked material has tarnished the reputation of Justice Minister Sérgio Moro, a federal judge until late last year, and the team of prosecutors leading the Car Wash investigation.
The most damaging involved chats showing that Mr. Moro, then the judge presiding over Car Wash, had provided strategic advice to prosecutors as they tried former President Luiz Inácio Lula da Silva on corruption and money laundering charges. Judges must be impartial arbiters under Brazilian law.
The leaked material has called into question the fairness of Mr. da Silva’s conviction, which prevented him from running for a third presidential term last year. Once Mr. da Silva, a leftist, was out of the race, Mr. Bolsonaro, a far-right populist, became the front-runner.
The chats also suggest the lead prosecutor on Mr. da Silva’s case, Deltan Dallagnol, discussed a plan to give lectures to high-paying clients through a company registered in his wife’s name. Such a venture does not appear to have materialized.
Mr. Moro and Mr. Dallagnol have denied wrongdoing and raised the possibility that some of the chats could be inauthentic.
Mr. Moro, who as justice minister is overseeing the hacking investigation, said Tuesday that “criminal hackers and unscrupulous people” had exploited a vulnerability that would soon be patched. He appeared to be referring to a security breach in the encrypted messaging app Telegram. Police officials in Brazil say the suspects used cloned SIM cards to access the material.
A federal judge on Tuesday authorized the detention of Mr. Delgatti and three other people in the hacking case. One of the suspects, Gustavo Santos, told authorities that Mr. Delgatti intended to sell the material to members of the leftist Workers’ Party, to which Mr. da Silva belongs, Mr. Santos’s lawyer said.
Leftist politicians and journalists from the Intercept have responded with skepticism to the arrests and have questioned Mr. Moro’s fitness to oversee the hacking investigation.
In a statement, the Workers’ Party called the detentions a “judicial farce” and denounced what it called efforts to link its leaders to the scheme.
The American journalist Glenn Greenwald, who is one of the founders of the Intercept, said Mr. Moro could not credibly oversee the hacking inquiry.
“Unthinkable in any democracy: Justice Minister Sergio Moro is commanding the investigation into our journalism even though his corruption is what we’ve exposed,” Mr. Greenwald wrote on Twitter.
The newspaper Estadão, citing law enforcement officials, said the initial target of the hacking effort was a prosecutor who had charged Mr. Delgatti with drug trafficking in 2015. After accessing content from the prosecutor’s phone, news reports said, Mr. Delgatti was said to have obtained the numbers of other government officials and taken data from their phones.
A lawyer for Mr. Delgatti this week said his client suffered from “psychiatric problems” and was in a state of shock. He could not be reached for comment Thursday afternoon.