Luiz Inácio Lula da Silva has won a fourth term as Brazil's president, overturning a first-round deficit to beat Senator Flávio Bolsonaro in a runoff that split the country almost evenly.
Lula took 51.8% of valid votes to Bolsonaro's 48.2%, according to the Superior Electoral Court, with nearly all ballots counted.
The remarkable comeback to win Brazil's presidency was also the first time since direct elections returned in 1989 that a candidate won the final runoff after losing in the first round.
The election process, however, was marred by allegations of voter suppression, with Lula's campaign reporting suspended public transportation in some key areas, prompting the court to extend voting by two hours. Bolsonaro's campaign had also requested an extension, citing heavy rains that shut polling stations in the south, a right-wing stronghold.
The victory of the 80-year-old leftist, who had trailed in the first round, blocks a rightward shift in Latin America that U.S. President Donald Trump has backed. Lula is set to govern from 2027 to 2030, facing a Congress where Bolsonaro's Liberal Party holds the largest bench in decades, and with substantial public debt that he must stabilize.