Jair Bolsonaro has won the vote by a wide margin. Brazilians cast their ballots in one of the most polarized elections in its democratic history, driven by discontent over rampant crime and corruption scandals.
Former army officer Jair Bolsonaro won the second round of Brazil's presidential elections, obtaining 55.1 percent of the vote, with 99 percent of the ballots counted. His leftist challenger Fernando Haddad of the worker's party was far behind him with 44.9 percent.
Bolsonaro's win signifies a sharp ideological right turn for the South American nation and adds another right-leaning government to the region.
Voting day was largely peaceful, said regional election monitor for the Organization of American States (OAS) Laura Chinchilla, "with no reports of violence or any other difficulty."
Bolsonaro supporters gathered in front of his home in the neighborhood of Barra da Tijuca in Rio de Janeiro, shortly after results were announced, waving Brazilian flags and setting off fireworks in celebration.
In his victory speech, the newly elected president said he never had doubts about winning and thanked God, noting an assassination attempt he suffered on the campaign trail.
"We cannot continue flirting with communism," Bolosonaro said. "We are going to change the destiny of Brazil," he vowed.
The former army captain said he would defend "the constitution, democracy and freedom," adding that "this is not the promise of a party, nor the word of a man. It is an oath before God."
Haddad had received a slew of late endorsements, including from members of Brazil's supreme court. "There are many democratic voices that could have been silent and have spoken in our favor," he had said when he cast his ballot, warning that democracy was in danger if Bolsonaro won.
But the warnings and endorsements were not enough to overcome a Bolsonaro 10-point lead that was forecast on the eve of the election.
In his concession speech, Haddad told supporters to "have no fear" and that his party now had the "enormous task" of defending "the thought, the freedoms of the 45 million Brazilians who voted for us."
The election had been marked by high polarization and voter anger over the rampant crime that plagues Brazil and the mammoth corruption scandal that has enveloped the nation. Haddad's Workers Party was implicated in this corruption probe, which led to the jailing of former president Luiz Inacio Lula da Silva.
Bolsonaro, who has served in the Brazilian Congress, was able to tap into voter discontent by campaigning as the anti-corruption candidate, with a tough-on-crime platform.
But the 63-year-old congressman, who was dubbed "Brazil's Donald Trump" or "Tropical Trump" was widely criticized for his stances against gay people, sexist comments about women, racist comments about Brazil's black population and his praise for the country's 1964-85 military dictatorship.
Leftists make gains in governor races
Despite the strong result for the far right at the national level, left-leaning parties dominated the governors races, winning 14 out of the 27 states. The Workers Party won four governorships in the northern part of the country, which is also the poorest. It was the most governorships won by any party.
But allies of the president-elect won the governorships of three of Brazil's most populous states: Sao Paulo, Rio de Janeiro and Minas Gerais.
Bolsonaro is expected to take office on January 1, 2019.