In some of his first words to the nation as president-elect, far-right politician Jair Bolsonaro has promised to defend the constitution and unite a bitterly divided populace.
His left-wing rival immediately vowed to mount a vigorous opposition, while rights groups warned against a rollback of civil liberties.
That juxtaposition underscored that the end of the election was not the end of acrimony and that myriad challenges lay ahead for Latin America's largest nation.
Bolsonaro appeared to try to allay those concerns Sunday night, saying he would "pacify" Brazil following a race that revealed deep divisions and was repeatedly marred by violence.
The candidate himself was stabbed and almost died while campaigning in early September, and there were numerous reports of politically motivated violence, especially directed at gay people.
"This country belongs to all of us, Brazilians by birth or by heart, a Brazil of diverse opinions, colors and orientations," he said, reading off a sheet of paper in a live television address.
More From This Section
But in a sign of the challenges ahead, the hashtag EleNaoEMeuPresidente HeIsNotMyPresident in Portuguese was the top trending topic on Twitter in Brazil on Monday morning.
Bolsonaro's victory moved Brazil, the world's fourth-largest democracy, sharply to the right after four consecutive elections in which candidates from the left-leaning Workers' Party won.
Like other right-leaning leaders who have risen to power around the globe, Bolsonaro built his popularity on a mixture of often outrageous or offensive comments and hardline positions. And, like many, he is sure to face stiff pushback from groups concerned that his strong views will lead to policies that threaten democratic institutions.
Bolsonaro has frequently disparaged women, gays and blacks, praised torture and killings by police, and has said he would name military men to his Cabinet.
He often took to Twitter to lambaste the rival Workers' Party as unethical and dangerous. In recent weeks, Brazilians were bombarded with WhatsApp messages that condemned Workers' Party candidate Fernando Haddad, often making outrageous claims.
Ultimately, Bolsonaro's messages resonated with Brazilians hungry for change: He got just over 55 per cent of the votes Sunday, compared to right under 45 per cent for Haddad.
Haddad promised a fight while saying he would respect the country's institutions.
"We have the responsibility to mount an opposition, putting national interests, the interests of the entire Brazilian people, above everything," Haddad said in a speech to supporters. "Brazil has possibly never needed the exercise of citizenship more than right now."
In a sign of how tense the race got, Haddad did not congratulate Bolsonaro and only on Monday morning did he wish him luck.
"I wish him success," he wrote on Twitter. "Our country deserves the best." Amid the celebrations by Bolsonaro's supporters, there were also reports of some clashes between his backers and opponents.
Among international leaders congratulating Bolsonaro was U.S. President Donald Trump, who tweeted Monday that he had "a very good conversation" with Brazil's president-elect.
"We agreed that Brazil and the United States will work closely together on Trade, Military and everything else!," Trump tweeted. "Excellent call, wished him congrats!" The judge who oversaw many of the cases in Brazil's massive corruption investigation also wished Bolsonaro well.
"It is important to enact, with dialogue and tolerance, reforms to improve the economy and the integrity of the public administration, as well as restoring the population's confidence in the political class," Judge Sergio Moro wrote in a statement.
The rise of Bolsonaro, who cast himself as a political outsider despite a largely lackluster 27-year career in Congress, parallels the emergence of hard-right leaders in many countries.
But his extreme messages were rendered more palatable by a perfect storm in Brazil: widespread anger at the political class after years of corruption, an economy that has struggled to recover from a punishing recession and a surge in violence.
In particular, many Brazilians were furious with the Workers' Party for its role in the graft scheme revealed by the "Operation Car Wash" investigation, which uncovered billions of dollars in bribes paid to politicians via inflated construction contracts.
Haddad struggled to build momentum with his promises of a return to the boom times by investing in health and education and reducing poverty. It didn't help that the man who appointed Haddad as the party's candidate, former President Luiz Inacio da Silva, is serving a 12-year sentence for a corruption conviction.
Bolsonaro's candidacy raised serious concerns that he would roll back civil rights and weaken institutions in what remains a young democracy. He has frequently disparaged women, gays and blacks, and said he would name military men to his Cabinet.
Within minutes of his victory being declared, international civil rights groups expressed concerns. Human Rights Watch called on Brazil's judiciary and other institutions to "resist any attempt to undermine human rights, the rule of law and democracy under Jair Bolsonaro's government.
Disclaimer: No Business Standard Journalist was involved in creation of this content