PORTO ALEGRE, Brazil (Reuters) - A Brazilian appeals court unanimously upheld the corruption conviction of former President Luiz Inacio Lula da Silva on Wednesday and added to his sentence, a major blow to the popular politician’s plans to run again for the presidency this year.

All three appellate court judges voted to uphold Lula’s convictions on taking bribes and money laundering. They also added 2-1/2 years to his sentence, condemning him to 12 years in prison. Lula, Brazil’s first working-class leader, so far remains free pending future appeals.

Lula, 72, could now be ineligible to stand for election under Brazil’s “Ficha Limpa” or “Clean Record” law, which bans political candidates whose convictions have been upheld by an appellate court.

Lula’s exclusion from the October election would radically alter the political landscape ahead of a campaign in which he is the early favorite, with 36 percent of voter preferences according to pollster Datafolha. That is double the percentage of his nearest rival, the far-right congressman and former army captain Jair Bolsonaro, who has been energized by anti-Lula sentiment.

But Lula still has options. An electoral court must make the final ruling on a candidacy, and would only do so once a candidate had registered.

Lula can appeal Wednesday’s decision by the appeals court in Porto Alegre to Brazil’s top appeals court or to the Supreme Court to delay a final ruling, possibly avoiding jail and stringing the process out long enough to register his candidacy by the Aug. 15 deadline.

At a nighttime rally in a central Sao Paulo plaza, Lula stood atop a sound truck and rallied supporters, blasting the ruling as a “lie”, and strongly maintained his innocence.

Slideshow ( 16 images )

Lula said that if the three judges could “show me the crime I committed, I would give up trying to be a candidate.”

“I want the judges to know that I am not worried like they think I should be,” Lula said. “They cannot jail ideas or hope.”

Opponents of Lula, meanwhile, celebrated on Sao Paulo’s main avenue with a giant blown-up figure of the ex-president dressed as a prison convict.

Brazil’s benchmark Bovespa stock index hit a new intraday high of 83,635 points on news of the ruling. It closed 3.32 percent higher on investor expectations his exclusion from the 2018 race will clear the way for a more market-friendly candidate who can stick to Brazil’s austerity agenda.

Brazil’s currency, the real, firmed 3 percent against the U.S. dollar, leading gains in Latin America.

“The ruling takes off the table the worst possible scenario for the market, the biggest downside possible in terms of the election,” said Roberto Campos, a partner at Sao Paulo-based Absolute Investimentos. “The guy who was completely not market-friendly is out.”

Slideshow ( 16 images )

MORE CASES

Lula is one of scores of powerful politicians and businessmen caught up in sweeping corruption probes that have wracked the Brazilian establishment since 2014.

He faces six more indictments in corruption cases ranging from receiving bribes from engineering firm Odebrecht [ODBES.UL] to obstructing justice and trafficking his influence to obtain government decisions favoring the auto industry.

He is among over 100 people convicted in the “Car Wash” investigation, the most sprawling of Brazil’s numerous probes. It focuses on graft involving oil firm Petroleo Brasileiro, known as Petrobras , and other state-run companies.

Lula was convicted of corruption and money laundering last year for accepting a beachside apartment from an engineering firm vying for contracts with Petrobras.

Prosecutors said the apartment and its refurbishing was a bribe worth 3.7 million reais ($1.1 million). Lula maintains he never owned the penthouse apartment, criticizing prosecutors for what Lula’s lawyers called a reliance on the plea bargain testimony of one witness, businessman Leo Pinheiro.

One of Lula’s lawyers, Cristiano Zanin, said the legal team would continue to fight the case, but that its next concrete steps would be decided in the coming days after they have had a chance to read the full ruling.

Lula’s Workers Party called the ruling a “farce” orchestrated by Lula’s enemies to stop him returning to power. The party said it would resist the decision and push ahead with its plan to launch him as presidential candidate.