Jair Bolsonaro, a nostalgic of the Brazilian military dictatorship, has been chosen as the new president of the largest economy in Latin America after one of the most divided and tense campaigns in the history of the country obtaining 55% of the votes after the scrutiny of more than 99% of the polls.
Bolsonaro spent much of the campaign exploiting divisions, taking to Twitter to lambaste the rival Workers' Party as unethical and risky. A bill granting Brazilians the right to own and bear firearms for legitimate self-defense is ready to be voted on in the lower house, and the former army captain's congressional allies have already indicated they'll fast-track the proposed measure as soon as he's elected. There were also reports of clashes between his backers and opponents on Avenida Paulista in Sao Paulo.
Later appearing outside his residence and reading from a lengthy prepared statement, Mr. Bolsonaro - who has embraced his "Brazil's Trump" moniker - said he would "break paradigms" and make his country's foreign policy "non-ideological". "He is a candidate who does not respect people or institutions", she added.
But he is also very much a product of a flawless storm in Brazil that made his messages less marginalised.
Meanwhile Bolsonaro's rival Haddad accepted defeat, saying he had a responsibility to join the political opposition.
Haddad has taken the opposite tack, promising to double-down on investment in education, health and social programs, arguing that the gains Brazil made in reducing poverty during the boom years have eroded and the poorest are suffering.
In the early stages of the campaign, the PT had attempted to put former president Luiz Inacio Lula da Silva on the ballot - despite the fact he is now serving a 12-year sentence for corruption. He said that wasn't just the words of a man but a promise to God.
While Haddad failed to get Gomes to endorse him, he won the backing on Saturday not just of Janot but of Brazil's most popular YouTube host, Felipe Neto, who has 27.7 million followers on his channel.
Bolsonaro's rise follows conservative electoral victories in Argentina, Chile, Colombia, Paraguay, and Peru, pushing the continent to the right and undermining support for the authoritarian socialist regime in Venezuela.
Bolsonaro, 63, is due to fly to Brasilia on Tuesday to start the transition process, which will culminate with his swearing-in on January 1.
Bolsonaro has promised to cut bureaucracy for businesses.
Bolsonaro has repeatedly said he would pull Brazil from the Paris agreement on climate change, though last week he backed off on that. Brazil has been plunged for years in a continuous institutional crisis by corruption cases uncovered especially by the "Lava Jato" investigations, released in 2014, which involved a large part of the country's politicians.
Beyond his inflammatory rhetoric, Bolsonaro has offered few specifics about how he would govern Brazil.
But many more Brazilians showed through their votes that they'd had enough of the Workers' Party, which steered the country from 2003 to 2016 through a boom-and-bust cycle that ended in an economic morass and the impeachment of his successor, President Dilma Rousseff. The economy suffered a two-year-long recession and is only beginning to emerge, with growth stagnant and unemployment high.
Many observers predicted that a newcomer would emerge to harness that anti-establishment anger. But numerous details of his positions remain unclear since he has largely conducted his campaign via blasts on social media.
"We can not continue flirting with socialism, communism, populism and the extremism of the left", he said in a speech transmitted live on Facebook - the platform he has campaigned on since an attacker stabbed him in the stomach at a rally on September 6, putting him in the hospital for three weeks.