Luiz Inacio Lula da Silva has won the Brazilian election.
He defeated far-right incumbent Jair Bolsonaro by polling 50.8% of votes compared with 49.2% for Mr Bolsonaro.
The Supreme Electoral Court's count was tallied with 98.8% of voting machines counted late on Sunday night.
READ MORE: Dundalk shooting victim 'lucky to be alive' as Gardai hunt for gunman in probe
More than 120 million Brazilians were expected to cast ballots, with the vote conducted electronically, including in Croke Park in Dublin.
Lula da Silva will be sworn in on New Year's Day.
During the campaign, he promised an increase in social and environmental responsibility, while his opponent promised to consolidate a sharp rightward turn in Brazilian politics.
After his victory was confirmed, Mr da Silva tweeted a picture of his hand over the Brazilian flag and the word: "Democracy."
It will be his third term as president, having previously served between 2003 and 2011.
Because of Covid and the cost of living crisis, many Brazilians are struggling financially under the Bolsonaro regime.
Many believed Lula to be the answer to their problems.
For the latest news and breaking news visit irishmirror.ie/news.
Get all the big headlines, pictures, analysis, opinion and video on the stories that matter to you.
Follow us on Twitter @IrishMirror - the official Irish Mirror Twitter account - real news in real time.
We're also on Facebook/irishmirror - your must-see news, features, videos and pictures throughout the day from the Irish Daily Mirror, Irish Sunday Mirror and irishmirror.ie.
READ NEXT:
Man hospitalised after shooting in Dundalk as gardai investigate circumstances of incident
Katie Taylor and Eddie Hearn eyeing up Croke Park after win over Karen Elizabeth Carabajal
Teenage girl killed after horror collision in Kerry as Gardai appeal for witnesses
Seoul stampede kills at least 146 with 150 more injured after street crush at Halloween event