An election victory by Mr. da Silva would be a dramatic return to power for him and his party two years after the impeachment of his protégé, Dilma Rousseff. Her removal elevated Mr. Temer, of the center-right Brazilian Democratic Movement party, to the presidency.

Federal Judge Sérgio Moro, the most prominent figure in the judiciary’s crackdown on political corruption, convicted Mr. da Silva in July on corruption and money laundering charges for accepting bribes from O.A.S., a major construction company, in the form of a seaside apartment that was being renovated to his liking. The judge sentenced Mr. da Silva to nearly a decade in prison, but ruled that he should remain free pending appeals.

Mr. da Silva has called the conviction a miscarriage of justice orchestrated by underhanded political actors within the judiciary.

“We will continue to fight this political conviction,” Cristiano Zanin Martins, Mr. da Silva’s lawyer, said in a statement on Wednesday. “And we will win this fight, not just for Lula but for all Brazilians who believe that the rule of law and democracy must prevail.”

Mr. da Silva’s supporters claim that he never lived in, or took ownership of, the renovated apartment at the heart of the case. They have cast doubt on the reliability of witnesses who implicated him, asserting that the witnesses testified in return for leniency in their own corruption cases.

They have also noted that politicians accused of more egregious wrongdoing — including President Temer, who was recorded appearing to condone the payment of a bribe — have so far dodged accountability.