Brazil’s top electoral court ruled Friday that jailed former president Luiz Inacio Lula da Silva cannot run in this year’s presidential election due to a corruption conviction.

The ruling by a 4-1 majority of the seven-member court removes some doubt about Brazil’s most uncertain election in decades - though Lula’s lawyers have said they would appeal any adverse decision to the Supreme Court.

The left-leaning da Silva, who was hugely popular when he left office in 2010, started serving a 12-year-sentence for corruption and money laundering in April. By law, the former president is barred from running because his conviction has already been upheld by one appeals court.

Story continues below advertisement

However, the former president and his Workers’ Party argue he should be able to run while he pursues further appeals.

Supreme Court Justice Luis Roberto Barroso said the decision to bar da Silva was “very simple” due to the conviction and later appeals court ruling.

He said the Workers’ Party should replace da Silva in up to 10 days and said he should not appear as a presidential candidate in free airtime that is given to political parties on nationwide TV and radio starting on Saturday.

Despite his conviction and several graft cases pending against him, Lula leads the race by a long stretch, with 39 per cent of voter support, according to pollster Datafolha. His nearest rival, far-right candidate Jair Bolsonaro, has 19 per cent.

Da Silva’s lawyers complained the court was rushing a decision because they submitted their defence only on Thursday and noted that the court rarely holds sessions on Fridays.

With da Silva barred, former Sao Paulo Mayor Fernando Haddad is seen as his party’s likely candidate for the presidency.

Currently Haddad is candidate for vice-president. Polls say the support for his bid as replacement is minimal so far, but da Silva’s resilient popularity could boost the former mayor’s hopes.