The former leader of Brazil, Lula, will join to anoint the presidential candidate

File image of Former President Luiz Inacio Lula da Silva

"The decision was made" for Fernando Haddad, a former mayor of Sao Paulo and Lula's vice-presidential candidate, to replace Lula, an official from the Workers' Party told AFP.

Hundreds of Lula supporters meanwhile gathered around the jail in the southern city of Curitiba where Lula has been held since April for corruption, pending the reading of a letter from the former leader who anointed Haddad as his political heir.

(ARCHIVE) Former Brazilian Minister Fernando Haddad

The decision comes less than two weeks after the Superior Electoral Court ruled that the popular but polarizing former president can not run while serving a 12-year sentence for corruption.

The court delivered the Workers' Party until 7:00 p.m. M. Local time on Tuesday (2200 GMT) to name a substitute.

Haddad is now locked in a race against the clock in the presidential election, with the first round less than a month away on October 7.

From this moment on, Haddad's ability to hold on to Lula's base will be key if he and his future running mate, young Communist Manuela d'Avila, reach the second round of Brazil's presidential elections.

Although imprisoned, Lula, 72, was the favorite in the polls, and his elimination from the race has turned the field, catapulting the right-wing populist Jair Bolsonaro.

A survey conducted by Datafolha on Monday shows Haddad, a 55-year-old man with little star power from his mentor, with nine percent support, five points more than a month ago.

That puts him in a mix of candidates who aspire to go to a second round of voting against Bolsonaro, who is currently at the front with 26 percent.

Clean blackboard rules

Lula supporters have camped outside the federal police headquarters in Curitiba since he was jailed on April 7.

The city is the epicenter of an extensive corruption investigation that has prosecuted dozens of politicians and business leaders, including Lula, who was president from 2003 to 2011.

He was convicted in July 2017 for accepting a bribe from a Brazilian construction company in the form of a luxury apartment by the sea in exchange for contracts with state oil company Petrobras.

Numerous appeals of conviction and sentence have failed, and his lawyers have also been unable to avoid the clean slate rules that have kept Lula out of the vote.

He faces trial in five other cases, but insists that he is the innocent victim of prosecutions motivated by political motives to keep him out of the office.

A former metalworker, Lula rose as a union leader during the Brazilian military dictatorship, co-founding the Workers' Party in 1980.

His presidency was credited with driving millions of people out of poverty through generous social programs, transforming his Workers' Party into a political power.

He has won the last four presidential elections, the last two by Dilma Rousseff, the successor chosen by Lula who was overthrown by Congress in 2016, accused of manipulating federal budgets.