Luiz Inácio Lula da Silva has been re-elected president of Brazil, the electoral authority has said, in a result that defied poll predictions - but his opponent has refused to accept the result.
It comes after an incredibly tight election race between the leftist incumbent, known widely as Lula, and Flávio Bolsonaro, the right-wing son of a jailed former president.
Lula is a vocal critic of Donald Trump, and while the result is set to provide relief to critics of the US president, it is likely to be met with dismay in Washington after the latest polls up until Saturday put Bolsonaro slightly ahead.
Nearly two hours after the result was announced, Bolsonaro said it was impossible to accept the count and he would be asking for the election to be annulled.
The voting was neck and neck throughout the count that took place on Sunday evening, until just after midnight UK time when Lula pulled ahead.
Lula's victory will mean the 80-year-old will serve an unprecedented fourth term.
Addressing his supporters, Lula expressed his gratitude to the Brazilian people and criticised Bolsonaro.
"This was a defeat for denialism and lies. I must confess that every time I attended a debate, I felt embarrassed," he said.
In a veiled swipe at the US, he said: "Either the homeland remains free, or we die for Brazil. This country will not accept being anyone's backyard."
With virtually 100% of the vote counted, Brazil's electoral court said Lula held an unassailable lead.
Its website said Lula got 51.79% of the votes, to Bolsonaro's 48.21%. 50% is required to win.
More than 33 million of the nearly 160 million registered voters did not vote.
A Supreme Court-mandated pause in vote counting late on Sunday injected confusion into the already tense run-off race.
Supreme Court Justice Cristiano Zanin, who was formerly Lula's lawyer, accepted a request by both campaigns to extend voting due to public transportation issues and heavy rain.
The decision was handed down three minutes before the 5pm cut-off time, creating confusion as some polling stations had already closed.
In a subsequent ruling, it was decided that polling stations that had not yet shut down their voting machines could continue receiving votes for an additional two hours.
'Impossible to recognise results'
Bolsonaro, 45, won the agricultural hub of the centre-west and the southern region, which borders Uruguay and Argentina.
But Lula overtook his challenger's gains by winning in the northeast and north, which includes the Amazon rainforest.
Bolsonaro, whose father is serving a 27-year prison sentence for attempting a coup after he lost the 2022 presidential election to Lula, later criticised the decision to extend voting hours as "changing the rules of the game".
"It's impossible to recognise the results of the election in the context of these things that happened," he said, pointing out that Zanin is Lula's former lawyer.
It's not clear if Bolsonaro's complaint meets the legal threshold to annul the results - but he can request a recount if there is evidence of fraud.
In the first round of the election earlier this month, Bolsonaro beat Lula by more than 2.2 million votes. Sunday's vote was for a run-off election of the two leading candidates.
More from Sky News:
Pro-Russian Serbian leader defeated
Ukraine, Russia and US talks to be held
A video published by his campaign showed Lula and his wife, first lady Rosângela da Silva, celebrating with a cake after the result was announced. Lula will turn 81 on Tuesday.
His triumph bucks a trend in Latin America where increasing numbers of right-of-centre presidential candidates allied with Mr Trump have been winning, further extending the US's influence in the region.
Other left-leaning leaders in the region were quick to congratulate Lula, including Mexico's President Claudia Sheinbaum.
"Long live democracy, the people of Brazil won. Congratulations, President Lula!," she said.
Cuba's President Miguel Díaz-Canel said: "Dear brother Lula, on behalf of the Cuban government and people, I congratulate you for this historic victory that ensures the continuity of the path of peace, sovereignty and social justice embarked upon by the Brazilian people under your leadership."
Brazil's financial markets slumped off the back of Lula's victory in Asian trading hours, and the Brazilian real was down 10%.
(c) Sky News 2026: Lula re-elected president in Brazil but his opponent Flavio Bolsonaro refuses to accept result

Met Office issues new wind weather warning - as two men killed by falling trees
The Ukrainian veteran of the battle for Mariupol who lost 25kg as a Russian prisoner of war
Second person charged in connection with shooting of police officer in Nottingham





