Former Brazilian President Luiz Inacio Lula da Silva speaks during a demonstration in his support, as former President Dilma Rousseff looks on, in Porto Alegre, Brazil, Tuesday, Jan. 23, 2018. File picture: AP Photo/Wesley Santos.

Porto Alegre - A Brazilian appeals court Wednesday upheld ex-president Luiz Inacio Lula da Silva's conviction for corruption, dealing a body blow to his hopes of running for re-election this year.

Two of the three judges in the appeals court in the southern city of Porto Alegre ruled that his original 9.5-year jail sentence be extended to more than 12 years.

A defiant Lula, 72, said before the judgment he would continue to fight "for the dignity of the Brazilian people" and insisted he had committed no crime.

The court convened amid high security in the tense southern city of Porto Alegre to rule on Lula's appeal against his July conviction in Brazil's sprawling "Car Wash" graft scandal, with thousands of supporters and opponents of the leftist icon gathered to await the ruling.

One of the judges, Joao Gebran Neto, described Lula as one of the architects "of a sophisticated scheme of fraud and corruption" that had weakened Brazil's entire political system.

Lula is expected to continue to challenge the conviction through the courts, but Wednesday's ruling deals a crushing blow to his hopes of running in this year's presidential election, which he was favored to win.

As the judges presented their verdicts, Lula was hundreds of kilometers (miles) away near Sao Paulo, addressing former colleagues in the powerful metalworkers' union he once led. 

"I am extremely calm, with the awareness that I have committed no crime," he told union members.

The leftist leader is accused of being gifted a three-floor seaside apartment from Brazil's OAS construction group in exchange for public contracts from state-controlled oil company Petrobras during his 2003-2010 presidency.

Defense lawyer Cristiano Zanin Martins had told the court it was clear OAS owned the apartment, and that Lula "never got the keys and never spent a night there." 

But in his judgment, Gebran Neto said there was evidence "that the triplex apartment, from the beginning, even before the OAS took over the works, was reserved for President Lula."

The defense had argued that no title existed in his name, but the judge said the lack of a document was intended precisely to hide the real recipient of the apartment.