In some of his first words to the nation as president-elect, far-right politician Jair Bolsonaro 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 the reality that the end of the election was not the end of acrimony and that myriad challenges lay ahead for Latin America’s largest nation.

A supporter of Jair Bolsonaro cries tears of joy after he was declared the winner of the election runoff, during a celebration in front of his residence in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018 . Bolsonaro, a brash far-right congressman who has waxed nostalgic for Brazil's old military dictatorship, won the presidency of Latin America's largest nation Sunday as voters looked past warnings that the former army captain would erode democracy and embraced a chance for radical change after years of turmoil. (AP Photo/Silvia Izquierdo)
A supporter of Jair Bolsonaro cries tears of joy after he was declared the winner of the election runoff, during a celebration in front of his residence in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018 . Bolsonaro, a brash far-right congressman who has waxed nostalgic for Brazil’s old military dictatorship, won the presidency of Latin America’s largest nation Sunday as voters looked past warnings that the former army captain would erode democracy and embraced a chance for radical change after years of turmoil. (AP Photo/Silvia Izquierdo)

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.

Jair Bolsonaro, presidential candidate with the Social Liberal Party, waves after voting in the presidential runoff election in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018. Bolsonaro is running against leftist candidate Fernando Haddad of the Workers’ Party. (AP Photo/Silvia izquierdo)
Jair Bolsonaro, presidential candidate with the Social Liberal Party, waves after voting in the presidential runoff election in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018. Bolsonaro is running against leftist candidate Fernando Haddad of the Workers’ Party. (AP Photo/Silvia izquierdo)

His 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 tough talk 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.

Flanked by his wife Ana Estela, left, and running mate Manuela d'Avila, Workers' Party presidential candidate Fernando Haddad delivers his concession speech, in Sao Paulo, Brazil, Sunday, Oct. 28, 2018. Brazil’s Supreme Electoral Tribunal declared far-right congressman Jair Bolsonaro the next president of Latin America’s biggest country. (AP Photo/Andre Penner)
Flanked by his wife Ana Estela, left, and running mate Manuela d’Avila, Workers’ Party presidential candidate Fernando Haddad delivers his concession speech, in Sao Paulo, Brazil, Sunday, Oct. 28, 2018. Brazil’s Supreme Electoral Tribunal declared far-right congressman Jair Bolsonaro the next president of Latin America’s biggest country. (AP Photo/Andre Penner)

Bolsonaro spent much of the campaign exploiting divisions, taking 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 percent of the votes Sunday, compared to right under 45 percent for Haddad.

Supporters gather outside the residence of presidential candidate Jair Bolsonaro in anticipation of his victory speech, in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018. Brazil's Supreme Electoral Tribunal declared the far-right congressman the next president of Latin America's biggest country. (AP Photo/Leo Correa)
Supporters gather outside the residence of presidential candidate Jair Bolsonaro in anticipation of his victory speech, in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018. Brazil’s Supreme Electoral Tribunal declared the far-right congressman the next president of Latin America’s biggest country. (AP Photo/Leo Correa)

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.”

A supporter of presidential candidate Jair Bolsonaro poses for a photo with an oversized, fake rifle, as she celebrates the election runoff results in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018. Brazil’s Supreme Electoral Tribunal declared the far-right congressman the next president of Latin America’s biggest country. (AP Photo/Silvia Izquierdo)
A supporter of presidential candidate Jair Bolsonaro poses for a photo with an oversized, fake rifle, as she celebrates the election runoff results in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018. Brazil’s Supreme Electoral Tribunal declared the far-right congressman the next president of Latin America’s biggest country. (AP Photo/Silvia Izquierdo)

In a sign of how tense the race got, Haddad did not congratulate Bolsonaro, whom he had accused of spreading lies about him and his family.

Amid the celebrations by Bolsonaro’s supporters, there were also reports of some clashes between his backers and opponents.

A supporter of Workers' Party presidential candidate Fernando Haddad embraces a fellow distraught supporter, after learning that rival Jair Bolsonaro was declared the winner in the presidential runoff election, in Sao Paulo, Brazil, Sunday, Oct. 28, 2018. Addressing supporters in Sao Paulo, Haddad did not concede or even mention Bolsonaro by name. Instead, his speech was a promise to resist. (AP Photo/Nelson Antoine)
A supporter of Workers’ Party presidential candidate Fernando Haddad embraces a fellow distraught supporter, after learning that rival Jair Bolsonaro was declared the winner in the presidential runoff election, in Sao Paulo, Brazil, Sunday, Oct. 28, 2018. Addressing supporters in Sao Paulo, Haddad did not concede or even mention Bolsonaro by name. Instead, his speech was a promise to resist. (AP Photo/Nelson Antoine)

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.

Supporters of presidential front-runner Jair Bolsonaro sing the national anthem outside his residence in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018, during the country's presidential runoff election. Brazilian voters decide who will next lead the world's fifth-largest country, the left-leaning Fernando Haddad of the Workers' Party, or far-right rival Jair Bolsonaro of the Social Liberal Party. (AP Photo/Silvia Izquierdo)
Supporters of presidential front-runner Jair Bolsonaro sing the national anthem outside his residence in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018, during the country’s presidential runoff election. Brazilian voters decide who will next lead the world’s fifth-largest country, the left-leaning Fernando Haddad of the Workers’ Party, or far-right rival Jair Bolsonaro of the Social Liberal Party. (AP Photo/Silvia Izquierdo)

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.

Supporters of Jair Bolsonaro celebrate in front of his residence in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018. The far-right congressman took a commanding lead in the race for Brazil's presidency, as voters apparently looked past warnings that the brash former army captain would erode democracy and embraced a chance for radical change after years of turmoil.   (AP Photo/Leo Correa)
Supporters of Jair Bolsonaro celebrate in front of his residence in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018. The far-right congressman took a commanding lead in the race for Brazil’s presidency, as voters apparently looked past warnings that the brash former army captain would erode democracy and embraced a chance for radical change after years of turmoil. (AP Photo/Leo Correa)

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.”

Steve Schwartzman of the Environmental Defense Fund warned that Bolsonaro’s promises about the environment would be “dangerous to the planet.”

A supporter of presidential front-runner Jair Bolsonaro wears a headband supporting his candidate as he waits with others for election results outside the National Congress in Brasilia, Brazil, Sunday, Oct. 28, 2018. Brazilian voters decide who will next lead the world's fifth-largest country, the left-leaning Fernando Haddad of the Workers' Party, or far-right rival Bolsonaro of the Social Liberal Party. (AP Photo/Eraldo Peres)
A supporter of presidential front-runner Jair Bolsonaro wears a headband supporting his candidate as he waits with others for election results outside the National Congress in Brasilia, Brazil, Sunday, Oct. 28, 2018. Brazilian voters decide who will next lead the world’s fifth-largest country, the left-leaning Fernando Haddad of the Workers’ Party, or far-right rival Bolsonaro of the Social Liberal Party. (AP Photo/Eraldo Peres)

Bolsonaro has repeatedly said he would pull Brazil from the Paris agreement on climate change, though last week he backed off on that. He has also promised to cut environmental regulations and make Brazil friendlier to international investors.

The past few years in Brazil have been exceptionally turbulent. In 2016, then-President Dilma Rousseff of the Workers’ Party was impeached and removed from office on charges that many on the left felt were politically motivated. The economy suffered a two-year recession and is only now beginning to emerge, with growth stagnant and unemployment high.

A woman, donning the Workers' Party official colror celebrates after voting in the presidential runoff election in Sao Paulo, Brazil, Sunday, Oct. 28, 2018. Brazilian voters decide who will next lead the world's fifth-largest country, the left-leaning Fernando Haddad of the Workers' Party, or far-right rival Jair Bolsonaro of the Social Liberal Party. (AP Photo/Nelson Antoine)
A woman, donning the Workers’ Party official colror celebrates after voting in the presidential runoff election in Sao Paulo, Brazil, Sunday, Oct. 28, 2018. Brazilian voters decide who will next lead the world’s fifth-largest country, the left-leaning Fernando Haddad of the Workers’ Party, or far-right rival Jair Bolsonaro of the Social Liberal Party. (AP Photo/Nelson Antoine)

Dozens of politicians and executives have been jailed in the corruption investigation.

Many observers had predicted a newcomer would emerge to harness the anti-establishment anger. Instead, support coalesced around Bolsonaro, who at the margins in Congress painted himself as just the strong man Brazil needed to dismantle a failing system.

Supporters of Brazilian presidential candidate Jair Bolsonaro cheer as they gather outside his residence in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018, during the country's presidential runoff election. Brazilians on Sunday were weighing their hunger for radical change against fears that Bolsonaro, the  presidential front-runner, could threaten democracy as they cast ballots in the culmination of a bitter campaign that split many families and was frequently marred by violence. (AP Photo/Leo Correa)
Supporters of Brazilian presidential candidate Jair Bolsonaro cheer as they gather outside his residence in Rio de Janeiro, Brazil, Sunday, Oct. 28, 2018, during the country’s presidential runoff election. Brazilians on Sunday were weighing their hunger for radical change against fears that Bolsonaro, the presidential front-runner, could threaten democracy as they cast ballots in the culmination of a bitter campaign that split many families and was frequently marred by violence. (AP Photo/Leo Correa)

Bolsonaro has promised to crack down on violent crime and drastically reduce the size of Brazil’s state. But many of the details of his positions remain unclear since he has largely conducted his campaign via blasts on social media. After he was stabbed, he declined to debate Haddad and gave interviews only to largely friendly media who rarely asked tough questions.

“Tomorrow we start a new country,” said Mario Marcondes, a 61-year-old pilot who gathered with other supporters outside Bolsonaro’s house. “This was like a soccer game, a dispute that is over. Now we will all know to unite.”

Workers' Party presidential candidate Fernando Haddad holds a Brazilian flag after casting his vote in the presidential election in Sao Paulo, Brazil, Sunday, Oct. 28, 2018. Brazilian voters decide Sunday who will next lead the world's fifth-largest country, the left-leaning Haddad or far-right rival Jair Bolsonaro. (AP Photo/Nelson Antoine)
Workers’ Party presidential candidate Fernando Haddad holds a Brazilian flag after casting his vote in the presidential election in Sao Paulo, Brazil, Sunday, Oct. 28, 2018. Brazilian voters decide Sunday who will next lead the world’s fifth-largest country, the left-leaning Haddad or far-right rival Jair Bolsonaro. (AP Photo/Nelson Antoine)

___

Source: The Associated Press