Rio de Janeiro: Veteran leftist Luiz Inacio Lula da Silva narrowly defeated President Jair Bolsonaro in a runoff election on Sunday that marked a stunning comeback for the leftist former president and the end of Brazil's most right-wing government in decades.
Brazil's Supreme Electoral Court declared Lula the next president, with 50.9% of votes versus 49.1% for Bolsonaro.
It is a stunning return to power for da Silva, 77, whose 2018 imprisonment over a corruption scandal sidelined him from that year's election, paving the way for then-candidate Bolsonaro's win and four years of far-right politics.
His victory marks the first time since Brazil's 1985 return to democracy that the sitting president has failed to win reelection. His inauguration is scheduled to take place on Jan. 1.
All eyes will now be on how Bolsonaro and his supporters react to the official result, after months of alleging -- without evidence -- that Brazil's electronic voting system is plagued by fraud and that the courts, media and other institutions have conspired against his far-right movement.
The victory marks a stunning turnaround for ex-metalworker Lula: he left office in 2010 as the most popular president in Brazilian history, fell into disgrace when he was imprisoned for 18 months on controversial, since-quashed corruption charges, and now returns for an unprecedented third term at age 77.
Bolsonaro, the vitriolic hardline conservative dubbed the "Tropical Trump," meanwhile becomes the first incumbent president not to win re-election since Brazil returned to democracy at the end of its 1964-1985 military dictatorship.
Electoral officials declared the election for Lula, who had 51 percent of the vote to 49 percent for Bolsonaro with more than 99 percent of polling stations reporting.