SÃO PAULO, Brazil — Luiz Inácio Lula da Silva’s face was everywhere at the Workers’ Party national convention: T-shirts featured him as a young metalworker, posters showed him as a seasoned politician wading through crowds and hundreds of supporters donned cardboard “Lula” masks.

Only Lula himself, as Mr. da Silva is popularly known, was missing from the kickoff of his presidential candidacy on Saturday.

“I am Lula!” the crowds shouted as they nominated Mr. da Silva with a show of hands.

The two-time president, who left office in 2011 with a record-high approval rating, now sits in a jail cell serving a 12-year sentence for corruption. The Supreme Electoral Court is widely expected to bar him from running for a third term in the October election.

But the charismatic leader could still be the deciding factor in this year’s splintered race.

The Workers’ Party insists Lula is the only name they will put on the ballot. Their aim is to generate enough popular support to force the courts to set him free and allow him to campaign. The party even delayed announcing a running mate until a day after the convention, keeping the spotlight on Mr. da Silva.

“Lula is innocent, so we won’t accept any other candidate,” Gleisi Hoffmann, a senator and the party’s national president, said in a recent interview. “What we’re looking at is political persecution.”

Many of his die-hard supporters agree. Ahead of Saturday’s convention, party faithful went on a hunger strike and vowed to march on Brasília later this month when parties will officially register their candidates with the top electoral court.

In Rio de Janeiro, tens of thousands attended a “Free Lula” concert where some of the country’s most popular musicians performed defiant ballads written during the military dictatorship.

Image

Mr. da Silva before surrendering to the police to begin serving a 12-year prison term in April.CreditLalo de Almeida for The New York Times

In the southern city of Curitiba, where he is imprisoned, Mr. da Silva has hosted a stream of high-profile visitors in his 161-square-foot cell on Thursdays, when friends and family are allowed to enter.

Support has poured in from foreign leftist leaders. Among them are former Presidents Michelle Bachelet of Chile and François Hollande of France as well as the Bolivian leader Evo Morales and 29 United States lawmakers, including Senator Bernie Sanders, who concluded in a letter, “The facts of President Lula’s case give us reason to believe that the main objective of his jailing is to prevent him from running in upcoming elections.”

Mr. da Silva was arrested in April after a dramatic standoff with the police, during which he declared: “I won’t be stopped because I am not a human being, I am an idea. And going forward all of you will become Lulas.”

As part of their Lula-or-bust strategy, several leading members of the Workers’ Party changed their names on social media accounts after he was jailed, adding Lula to their handles. Ms. Hoffmann was among them.

“The judiciary, the elite, the media, they have done everything to try and impede him,” Ms. Hoffmann said. “They thought the only way to stop Lula was to physically remove him, to put him in jail. But far from stopping him, it has just made people more supportive.”

Mr. da Silva, who faces several other corruption charges, leads electoral polls by a wide margin, with 30 percent of Brazilians saying they would vote for him. Perhaps more important, 47 percent say they would “certainly” or “perhaps” vote for a candidate he endorses, according to a recent survey by Datafolha.

That is an impressive showing for someone who has not made a public appearance since April, who can’t record videos, grant interviews to journalists or weigh in on Twitter in real time — although the party updates his social media accounts frequently.

That loyalty is a testament to his devoted following among poor and middle-class Brazilians, especially in the northeast.

Image

A man placed masks of Mr. da Silva on seats before the Workers’ Party national convention on Saturday.CreditNelson Almeida/Agence France-Presse — Getty Images

“Politics are ugly, but Lula is the only politician who has ever done anything for poor people,” said Josué Eduardo, a gardener from Recife, in Mr. da Silva’s home state of Pernambuco. “Thanks to Lula, my mom’s village got electricity for the first time and my daughter got a house. If he tells me to vote for someone, I will.”

Political analysts say that Mr. da Silva is quietly working with the Workers’ Party, or PT, on a Plan B candidate who could be endorsed at the last minute, but that keeping the former president in the race as long as possible is crucial to the party’s strategy of promoting him as a martyr.

“The only way the PT remains relevant in Brazilian politics is if they have a really united front on Lula,” said Monica de Bolle, the director of Latin American studies at Johns Hopkins University. “The PT is Lula.”

Like other political lions of the Latin American left, Mr. da Silva has so far not leveraged his popularity to groom a younger generation of successors. Leaders like Hugo Chávez in Venezuela and Evo Morales in Bolivia were transformational, but critics argue that instead of creating sustainable political movements, their success was built on the cult of personality.

Still, betting on Mr. da Silva has its risks. Many supporters have turned against him, holding him responsible for the rampant corruption and bribery scheme revealed by the continuing Lava Jato, or Car Wash, investigation. While 30 percent of Brazilians say they would vote for him, he now has a 36 percent rejection rate.

Critics say Mr. da Silva and his party would have been better off supporting other left-wing leaders who have not been tainted by the corruption scandal instead of dividing the base.

This election could be a test of the Workers’ Party power without Mr. da Silva as the headline act.

For now, he still seems to be calling the shots from prison.

Although no cellphones or electronic equipment are permitted, Mr. da Silva can receive visits from lawyers five days a week. These have become his main means of communicating with the party, his base and the public. Through his lawyers, he has released handwritten notes and even a couple of op-eds, circumventing the prohibition on press interviews.

Fernando Haddad, a former mayor of São Paulo who was named the PT’s vice-presidential candidate late Sunday, is registered as one of Mr. da Silva’s lawyers, giving him unfettered access to the former president.

Even before his nomination, Mr. Haddad took the lead in promoting the party’s platform for the coming election and was widely considered Mr. da Silva’s most likely heir, although he vehemently denies any talk of a Plan B.

“Our insistence on Lula wasn’t the result of an electoral calculation, but of moral necessity,” Mr. Haddad said during a recent interview at his home in São Paulo. “But it has ended up working out that way, because he just keeps climbing in the polls.”

Mr. Haddad has been making the rounds presenting the “five axes” of Mr. da Silva’s government plan. These include general guidelines to revive the economy with public investment, an expansion of a program that deployed doctors in underserved areas and the promise to impose taxes on banks that refuse to lower interest rates on credit, which are some of the highest in the world.

Mr. Haddad says party leaders hope that once the candidacies are officially registered on Aug. 15, Mr. da Silva will be allowed to exercise his political rights, recording ads for the free television campaign time allotted to parties and possibly participating in debates.

But legal experts say the situation is unprecedented — and complicated.

“Lula will have the same political rights in a broad sense, at least for now, but he will face the limitations of a criminal conviction,” said Savio Chalita, a professor of electoral law. This means a criminal judge would have to grant the former president permission to leave the prison to go on the campaign trail or bring recording equipment into his cell, Mr. Chalita said.

And then, there is the very likely scenario that the electoral court will rule him ineligible for office as a result of his corruption conviction. In that case, the party would have until 20 days before the vote to put forward another name.

The longer the party waits, the less time it will have to promote a stand-in. It also raises the possibility that the country could face the first election of disputed legitimacy since the end of a military dictatorship in 1985.

“When you prevent the most popular leader in the country from running for election, the risk for Brazilian democracy is very high,” Ms. Hoffmann said.

A version of this article appears in print on , on Page A8 of the New York edition with the headline: As ‘Lula’ Sits in Brazil Jail, Workers’ Party Nominates Him for President. Order Reprints | Today’s Paper | Subscribe