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

A majority of justices on Brazil’s electoral court voted late Friday to bar ex-President Luiz Inacio Lula da Silva from running in October’s presidential election, virtually ending any chance that the front-runner will get on the ballot.

The decision, while long expected, leaves tens of millions of voters without a candidate and adds uncertainty to the race to lead Latin America’s largest nation.

After several hours of debate late Friday, five justices had voted against da Silva’s candidacy and just one in favor. One more was still to vote, though the majority was enough to seal da Silva’s fate.

Da Silva was wildly popular as president of Latin America’s largest nation between 2003 and 2010. U.S. President Barack Obama once called him the “most popular politician on earth.” But da Silva and his Workers’ Party have lost much of that appeal over the last several years amid a sprawling corruption probe that has ensnared many top businessmen and politicians, including da Silva.

Da Silva, serving a 12-year-sentence for corruption and money laundering, is the front-runner despite being in jail. Under Brazilian law, da Silva is ineligible to run because his conviction was upheld on an initial appeal. But da Silva and supporters had hoped the Supreme Electoral Tribunal, which makes final decisions on candidacies, would allow him to run.

Da Silva has long argued that he should be allowed to run because his conviction was a sham. Judge Sergio Moro convicted da Silva of trading favors with construction company Grupo OAS in exchange for the promise of a beach house apartment.

Supreme Court Justice Luis Roberto Barroso cast the first vote, saying barring da Silva was “very simple” due to the conviction and upheld appeal.

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

With da Silva out, former Sao Paulo Mayor Fernando Haddad was expected to take his place on the Workers’ Party ticket. Currently Haddad is candidate for vice president. Polls show tepid support for his bid as replacement, but the party hopes da Silva’s popularity could boost the former mayor’s hopes.