Lula da Silva has been declared the winner of the Brazilian election, in a result that will send shockwaves throughout South America.
The left-wing candidate defeated Senator Flavio Bolsonaro, the eldest son of former President Jair Bolsonaro. The senator had finished first in the election's first round and hoped to revive his father's far-right movement.
At times, Lula's reelection looked like a long shot, as voters soured on him and his Workers' Party after years of corruption scandals and rising prices, while sweeping societal changes left the former metalworker and union leader looking out of touch with an increasingly app-based economy and its growing ranks of informal workers.
Lula's victory marks another comeback in a career full of them. The 80-year-old was jailed from 2018 to 2019 on corruption charges that were later overturned, paving the way for him to beat Jair Bolsonaro in the 2022 election.
"He is a statesman, a giant," leftist federal lawmaker Erika Hilton, who was with Lula in Sao Paulo during the vote count, told Reuters
Pollsters said better-than-expected turnout had powered Lula to victory. Leonardo Barreto, the co-founder of consultancy Think Policy, said voters had chosen Lula's familiar embrace over Bolsonaro's novelty.
"People today are choosing between change, with some apprehension, and a known path, which guarantees certain rights," he said.
During the campaign, Lula pointed to a track record of falling poverty and inequality, while unemployment, illiteracy and deforestation hit record lows during his third term.
He warned Bolsonaro would cut welfare spending, backslide on social advances and hand over Brazil's sovereignty to US President Donald Trump, whose State Department led a campaign to get the Bolsonaros back to power.
Lula's win deprives Trump of a major addition to what has been a growing bloc of friendly right-wing Latin American governments that have embraced Washington's agenda on security and migration.
Celso Amorim, a former Lula foreign minister, told Reuters the leftist "would be very important for establishing a point of balance in Latin America. Lula is that balance."