Higher courts have been generally upholding convictions linked to Car Wash, a four-year probe into bribes paid by construction companies to public officials in exchange for lucrative government contracts, many with the state-owned oil company.
But Lula's Workers' Party has vowed to stick by his candidacy no matter what. His ardent supporters immediately took to the streets, denouncing the decision as a politically motivated gambit.
His backers built a small tent city here ahead of the verdict, complete with makeshift stores and restaurants. Today they marched as close as they could get to the courthouse, but huge lines of police officers on horseback held them back.
"We were extremely poor before Lula, misery, extreme poverty," said Valdik Santos, 41, who took a bus 3 1/2 days from Brazil's poor northeast be in Porto Alegre for the verdict. "With Lula, we were able to buy a car, cell phones, furniture. . . . There is no proof that Lula is corrupt. The right and elite just don't want him to run because they know he will win."
Defiant, Lula has vowed to fight on.
"I know I didn't commit any crimes," Lula told a crowd of excited supporters gathered in Porto Alegre. "I doubt there is anyone more innocent than me."
Protesters against Lula held several small rallies across the country but did not draw large numbers. Pro and anti Lula forces have both scheduled marches for the same location today in Sao Paulo, Brazil's largest city.
Lula's 2017 conviction stems from allegations he accepted the remodeled beachfront pad in a middle-class resort in return for public contracts. If the final judge favours Lula, a split verdict means he could appeal to the full panel of judges at the circuit court level before two more layers of remedy possible at higher courts in Brasila, the capital. If the decision is unanimous, he would have two, not three, appeals left.
"I don't think he has a good chance of winning," said Oscar Vilhena Vieira, professor of constitutional law at the Fundação Getulio Vargas, a Sao Paulo-based university.
However, Lula can also apply to an electoral tribunal for a special exemption to run despite the conviction against him if his appeal drags on.
"One thing that could play to Lula's advantage is that political considerations are likely to play an increasingly important role in the process," said Peter Hakim, a senior fellow at the Inter-American Dialogue. "To be sure, the decisions will, for the most part, be made by mostly honest and competent judges. But, like judges in the US, they do have political views that affect their reasoning."
The decision will shape the 2018 presidential race in a nation exhausted by non-stop political scandals.
In October, Brazilian lawmakers blocked a corruption trial against President Michel Temer after concessions to pro-business political factions. Temer took office in 2016 after President Dilma Rousseff was impeached for fiscal abuses. But Temer remains hugely unpopular, with approval ratings as low as 3 per cent.
If Lula is ultimately unable to run, it could present an opening for the right - including far-right firebrand Jair Bolsonaro or Sao Paulo Mayor João Doria, a businessman turned host of Brazil's version of The Apprentice, who has been widely compared to Trump.
Lula's "base sees him as a godlike figure," said Heni Ozi Cukier, a political scientist at ESPM University, also in Sao Paulo. "If Lula is in the election, the election becomes about who can beat Lula. Without Lula, it's a very open playing field."
The conviction has amounted to a hard fall from grace for a man who was once the most popular president in Brazil's history and was described by President Barack Obama as "the most popular politician on Earth".
He was the nation's first leader from a poor background - a factory worker who made his way into politics by way of prominent labour unions. Under his leadership, Brazil's economy boomed, and 40 million people rose out of poverty as he built an ambitious social safety net called "zero hunger."
Yet Lula is currently accused of seven other crimes - including other counts of corruption, influence peddling and illegal campaign financing. In addition to the beach apartment in the middle-class resort of Guarujá, prosecutors say he received an apartment on the outskirts of Sao Paulo and a US$4 million plot of land where his charitable institute is located.
Lula and political allies maintain that the charges are all politically motivated. Lula's defence team says he and his wife, Marisa, never owned the beachfront apartment that was the basis of his conviction and today's appeal; it says they only visited it to consider purchasing it.
"This process has been marked by gross violations of due process," one of Lula's lawyers, Cristiano Zanin Martins, said this week. "The prosecutors have utilised the press and social networks to try to demonise Lula and try to impede his right to be innocent until proven guilty."
Yet the appeals court said witness testimony indicated that the apartment in question had been reserved for Lula and his wife and that renovations on it were made at his request. The court took issue with the defense team's insistence that the judges were acting as the political puppets of Lula's right-wing opponents.
"Just like what happened with American president Richard Nixon in the Watergate case . . . we now see [that] the law is for everyone," said Justice Leonardo Paulsen.