On Oct. 7, as Brazilians were going to the polls in the first round of voting, Senate candidate Flavio Bolsonaro shared a video on Twitter that purportedly showed a voting machine that had been tampered with.
Brazil's top electoral court said Bolsonaro won with just over 55 percent of the vote, compared with just under 45 percent for Haddad.
Riot police separated supporters of Bolsonaro and those of his leftist rival Haddad when they briefly scuffled in Sao Paulo.
During the presidential campaign, Bolsonaro announced that he would not accept the election results unless he won.
Mr Bolsonaro's sudden rise from relative obscurity to presidential candidate has been driven by a rejection of the PT which ran Brazil for 13 of the last 15 years. He stands for multilateralism and a bigger role for regional organizations, such as Mercosur and BRICS.
Supporters wearing t-shirts emblazoned with Bolsonaro's face and Brazil's yellow and green national colours assembled outside his house in the Barra da Tijuca neighbourhood of Rio de Janeiro. After winning a first round earlier this month - but falling short of outright victory - Bolsonaro two weeks ago was leading his leftist challenger, Fernando Haddad, in opinion polls by 18 percentage points. The Workers' Party founder, known simply as Lula, is serving a 12-year sentence for corruption.
Bolsonaro, a 63-year-old former army paratrooper, managed to capitalize on the disappointment and anger of a population hit by years of recession and stagnation and tired of corruption scandals.
"Brazil will not become a dictatorship, we won't see congress closed", said Mauricio Santoro, a political scientist and professor of worldwide relations at Rio de Janeiro State University.
Mr Haddad has promised a continuation of many progressive policies of his Workers' Party, which governed from 2003 to 2016.
The past few years in Brazil have been exceptionally turbulent. The economy suffered a two-year recession and is only beginning to emerge, with growth stagnant and unemployment high. And scores of politicians and executives have been jailed in the Carwash corruption investigation that uncovered a multi-billion-dollar scheme to trade public contracts and official favors for bribes and kickbacks. There were numerous reports of politically motivated violence, especially directed at gay people. Witnesses said several men shouted Bolsonaro´s name during an argument with a transgender woman in São Paulo on October 16, then killed her. Bolsonaro himself was stabbed during a rally in September.
Trump trod a very similar path. "Bolsonaro is essentially saying, 'Fairness means that I win".
"All these people here are outraged, upset about corruption and crime, and we are with Bolsonaro".
Meanwhile, polling revealed an increase in support for Jair Bolsonaro.
Many observers predicted that a newcomer would emerge to harness that anti-establishment anger.
Bolstering his rebel image is his reputation for offensive statements and sometimes extreme views, including insulting women, black people and the LGBT community.
Among those crises: Brazil's economy shrank almost seven percent during its worst-ever recession, from 2015 to 2016; the multi-billion-dollar Petrobras scandal has left voters disgusted with the seemingly bottomless corruption of politicians and business executives; and there is widespread outrage over violent crime, in a country that registered a record 63,880 murders a year ago.
But opponents of Mr Bolsonaro have warned he would trample on human rights, curtail civil liberties and muzzle freedom of speech.
- Most active Western Conference teams this offseason
- Dodgers win longest World Series game ever 3-2
- Saudi prosecutors: Jamal Khashoggi killing was premeditated
- Google fires dozens for sexual harassment in 2 years
- China and Russian Federation are reportedly eavesdropping on Trump's phone calls
- Breast cancer is Aegon's biggest CI claim cause
- Smart money points to Trump charge
- Klopp: Liverpool players voted for Van Dijk captaincy
- Central Intelligence Agency gets hands on 'all Turkey's Khashoggi murder evidence'
- Red Dead Redemption 2 Companion App Heading to Android And iOS