Brazil's President Luiz Inácio Lula da Silva has won a fourth term in office in a dramatic comeback, defeating his right-wing challenger Flávio Bolsonaro in a bitterly contested election.
Lula secured 51.79% of the vote against Bolsonaro's 48.21%, a difference of approximately 4.4 million votes between the two candidates.
The result makes Lula the first Brazilian president in history to win a fourth term and the first since the return to civilian rule in 1985 to win an election after losing the first round of voting.
Speaking to celebratory crowds, Lula described the result as a "loss for negativity, lies" and declared "long live democracy."
Flávio Bolsonaro, son of convicted former president Jair Bolsonaro, refused to recognise the result and called for it to be annulled. Experts say such an outcome is unlikely.
In an unprecedented move, polling hours were extended by two hours on Sunday evening after both campaigns submitted separate requests. Lula's team argued that voters in São Paulo and Bahia were unable to reach polling stations due to a lack of buses. The Bolsonaro campaign cited heavy rain in parts of the south and in São Paulo.
The extension was ordered by the Supreme Court just as polling stations were due to close, meaning some had already shut and could not reopen.
Supreme Court President Kassio Nunes Marques, who was appointed by former president Jair Bolsonaro, confirmed Lula's victory and stated that the voting extension did not affect the count or the integrity of the electoral process.
Lula, who turns 81 on Tuesday, has previously served three non-consecutive terms — two between January 2003 and December 2010, and a third beginning in January 2023. His new term is set to begin on 5 January and will run until 2030.
The incoming term comes amid significant challenges both at home and abroad, including a strained relationship with US President Donald Trump. Referring to what Trump has called the "Donroe Doctrine" — which seeks to establish US dominance in the Western Hemisphere — Lula used his victory speech to insist that Brazil "will not accept being anyone's backyard."
Trump has previously expressed support for Jair Bolsonaro, who is currently serving a 27-year prison sentence after being convicted of a coup attempt following his 2022 election defeat to Lula. Flávio Bolsonaro met Trump at the White House earlier this year in a bid to secure his backing.
Trump had not publicly reacted to the result at the time of reporting.
Lula's victory also runs counter to a broader trend across Latin America, where voters in countries including Argentina, Chile and Colombia have brought right-wing candidates and parties to power.
World leaders were quick to offer congratulations. European Commission President Ursula von der Leyen said "democracy and multilateralism" had won. Spanish Prime Minister Pedro Sánchez called it a "great victory," adding that "the comeback of global progressivism has just begun." French President Emmanuel Macron said the two nations should work "in service of a more just world."
Ecuador's President Daniel Noboa Azin said the region had "common enemies, shared challenges, and much to gain when we work together." South African President Cyril Ramaphosa described the result as a victory for the "global south and progressive forces throughout the world."