(CNN)Imprisoned former Brazilian President Luiz Inacio Lula da Silva abandoned his party's presidential bid on Tuesday, weeks before an election in which he was considered a front-runner.
Former Brazilian President Lula da Silva drops electoral bid
Running mate and former Sao Paulo Mayor Fernando Haddad will take Lula's place on the October 7 ballot, according to Lula's Workers' Party.
The switch comes after the country's top electoral tribunal barred the convicted former head of state from running.
In a letter, Lula urged his supporters to now back his running mate.
"We are already millions of Lula's and from now on, Haddad will be Lula for millions of Brazilians," he wrote.
The Superior Electoral Court had given the party until Tuesday to name Lula's replacement on its presidential ticket, state-run Agencia Brazil news reported.
The Workers' Party made the announcement Tuesday in the southern city of Curitiba, where the former president was running a behind-bars campaign while serving his sentence.
The party's official Twitter account featured images of Lula and Haddad calling Lula "the best president that Brazil ever had" and asking voters to "overcome the injustices" with unity.
Haddad will face Jair Bolsonaro, 63, in the election. Bolsonaro's campaign has been interrupted since last week, after he was stabbed during a rally while campaigning.
The far-right candidate, known to many of his countrymen as the "Brazilian Trump," will likely be unable to resume campaigning ahead of October's vote, his son has said, while urging supporters to continue on Bolsonaro's behalf.
Police arrested and charged Adelio Bispo de Oliveira, 40, in connection with the attack.
Universally known as Lula, Lula da Silva is one of his country's most popular politicians and a founding member of Brazil's only socialist political party.
A former metalworker and union leader, he rose through the political ranks to serve two terms as president between 2003 and 2011. He left office with a 90% approval rating, after his policies helped lift millions of Brazilians out of poverty.
But he has been in jail since April after he was sentenced to 12 years for corruption and money laundering. The accusations against him emerged after he left office in 2011.
The 72-year-old has strongly denied any wrongdoing. His defense said he was a victim of political persecution.
Earlier this month, Brazil's top electoral court barred Lula da Silva from running for re-election because of the corruption conviction.
Six of seven justices from the Supreme Electoral Tribunal in Brasilia ruled that Lula was ineligible to run.
Brazilian law bars candidates whose conviction has been upheld on appeal.
Lula da Silva has been in prison since he surrendered to federal police in April. Since then, Workers' Party politicians and supporters have held rallies calling for his release and claiming his innocence.
His conviction stemmed from a wide-ranging corruption investigation into the state-run oil company Petrobras, dubbed "Operation Car Wash."
Lula da Silva was accused of benefiting from the renovation of a triplex in a beach town near Sao Paulo by the construction company OAS.
The charges were connected to 3.7 million reais' worth of bribes ($1.1 million) received from OAS through the beachfront apartment. In return, Lu