The conviction is the latest salvo by Brazil’s judicial branch, which has declared war on the country’s entrenched culture of corruption. Brazil’s current president, Michel Temer, was charged last month with corruption, part of a near constant stream of allegations and charges that have ripped through the nation’s political establishment in recent years.

Judge Moro, who oversees cases stemming from a broad graft scandal surrounding the state-controlled oil company, said Mr. da Silva’s actions were part of a “scheme of systemic corruption” at Petrobras.

“The president of the republic has enormous responsibilities,” Judge Moro wrote. “As such, his culpability is also” enormous when he commits crimes, he added.

Mr. da Silva presided over a period of robust economic growth in Brazil and remains a widely popular figure, credited with leading a social transformation that lifted millions from poverty in a nation with one of the world’s biggest disparities between rich and poor.

Despite the corruption allegations against him and his party, Mr. da Silva has been leading in recent public opinion polls on the election. Judge Moro, the judge who convicted him, is often cited as Mr. da Silva’s closest rival in hypothetical matchups in the presidential race, though Judge Moro has ruled out running for office.

“We view this as an attempt to push Lula out of the electoral process,” said Senator Gleisi Hoffmann, who recently took the helm of the Workers’ Party. “A presidential election without the participation of Lula is fraudulent and undemocratic. If you want to take him out of the running, then put up a candidate and run against him in the electoral booth.”

Mr. da Silva’s lawyers said in a statement issued Wednesday night that the former president is innocent. They called him the victim of a politicized prosecution, “a famous strategy that has been used to brutal effect by various dictatorships throughout history.”