Former army captain Jair Bolsonaro has won Brazil's presidential election, riding a wave of frustration over corruption and crime that brought a dramatic swing to the right in the world's fourth-largest democracy, official results have shown.
Elsewhere, in the gubernatorial elections, in Sao Paulo, former mayor, media tycoon and once host of Brazil's version of The Apprentice TV programme Joao Doria won the race against incumbent Marcio Franca.
In Brazil's commercial capital of Sao Paulo, Mr Bolsonaro's win was greeted with fireworks and the honking of vehicle horns.
In Sao Paulo, Brazil's largest city, vehicle horns could be heard honking and crowds celebrated as the results came in.
Several hundred PT demonstrators protested Bolsonaro's victory on Sao Paulo's main Paulista Avenue before police dispersed them using tear gas.
Many in the country are furious with the Workers Party over its involvement in a graft scheme known as the carwash, and Mr Bolsonaro has pledged to crack down on corruption and reduce the number of state ministries.
In a highly unusual moment, the chief justice of the Supreme Court, Jose Dias Toffoli, read out part of the Constitution to reporters after he voted.
Mr Bolsonaro was a clear front runner for much of the campaign, winning 46% to Mr Haddad's 29% in the first round of elections on 7 October.
In addition, the transition period until January 1, when he will be sworn in to replace outgoing President Michel Temer, now gives Mr. Bolsonaro time to "reconfigure" and soften some of his more extreme talking points and positions, Mr.de Almeida noted.
"Brazil will not become a dictatorship, we won't see congress closed", said Mauricio Santoro, a political scientist and professor of global relations at Rio de Janeiro State University.
Have the right to vote more than 147 million voters.
Minutes after he was elected, several global human rights groups put out statements demanding that Bolsonaro respect Brazil's democracy.
Flash flood in Jordan sweeps away school bus, killing at least 18
Jordan's state news agency, Petra, confirmed the death toll in a tweet, saying dozens more had been rescued. Iyad al Omar told Reuters the number of casualties was expected to rise.
As late as Sunday morning, Haddad was still holding out hope that he could win after several key endorsements late Saturday.
As widely predicted, Jair Bolsonaro is the new president of Brazil after Sunday's balloting. But the hugely divisive Workers' Party founder was barred from running because he is serving a 12-year prison sentence.
The past few years in Brazil have been exceptionally turbulent.
Fernando Haddad of the leftist Workers' Party voted in Sao Paulo and said he was "confident we can win".
The center-right leader took over from Lula's successor, Dilma Rousseff, after she was impeached in 2016 for financial wrongdoing in office, ending the Workers' Party's 13 years in power. The economy suffered a two-year-long recession and is only beginning to emerge, with growth stagnant and unemployment high.
That instability unleashed extreme anger with the political class but also revealed deep divisions in Brazilian society, and this campaign was the most polarized in decades.
Throughout the campaign, dozens of politically motivated acts of violence were registered by voters, journalist and politicians.
Pinera tweeted to Bolsonaro: "I am sure we will work with vision and strength toward a future that will favor integration and the welfare of our people".
"All these people here are outraged, upset about corruption and crime, and we are with Bolsonaro".
Voting stations throughout most of Brazil are closing as the country's presidential election nears an end.
Casting himself as a political outsider, Mr Bolsonaro ran a campaign characterised by violent talk and far-right positions, including praise for Brazil's 1964-1985 military dictatorship, support for torture, and outright racism, misogyny and homophobia.