Updated

Brazil’s Supreme Electoral Tribunal declared Sunday that anti-establishment congressman Jair Bolsonaro, a champion of traditional Brazilian values, has won the country's election for the presidency of Latin America’s biggest country and the world’s fourth-largest democracy.

Bolsonaro, who cast himself as a political outsider despite a 27-year career in Congress, is the latest of several leaders around the globe to gain prominence by mixing tough, often violent talk with right-wing positions. But he also is very much a product of a political tempest in Brazil that made his messages less marginalized: widespread anger at the political class amid years of corruption, an economy that has struggled to recover after a punishing recession and a surge in violence. The name of his party, PSL, translates to "Social Liberal Party," although it largely abandoned its socially liberal platforms after he joined.

Bolstering his rebel image is his reputation for offensive statements and sometimes extreme views, including insulting women, black people and the LGBT community.

“I’m afraid to go out at night when it gets dark,” said Raquel Nunes, 27, a secretary from Sao Paulo and an avid Bolsonaro supporter, as The Wall Street Journal reported. “But he’s going to solve this, he’s going to be firm, talking didn’t get us anywhere so we need to respond with force.”

In a highly unusual moment, the chief justice of the Supreme Court, Jose Dias Toffoli, read out part of the Constitution to reporters after he voted.

“The future president must respect institutions, must respect democracy, the rule of law, the judiciary branch, the national Congress and the legislative branch,” Toffoli said in remarks many took to be a rebuke of Bolsonaro and his more extreme positions.

Supporters of Jair Bolsonaro singing the national anthem in front of his house during the presidential runoff election in Rio de Janeiro, Brazil, on Sunday. (AP Photo/Silvia Izquierdo)

Supporters of Jair Bolsonaro singing the national anthem in front of his house during the presidential runoff election in Rio de Janeiro, Brazil, on Sunday. (AP Photo/Silvia Izquierdo)

With 96 percent of ballots counted, Bolsonaro had 55.5 percent of the votes. Leftist Fernando Haddad of the Workers’ Party had 44.5 percent.

MIGRANT CARAVAN STOPS IN MEXICO

“We have everything we need to become a great nation,” Bolsonaro said Sunday night in a video broadcast on his Facebook account shortly after he won, as The New York Times noted. “Together we will change the destiny of Brazil.”

Voters in Sunday’s runoff election apparently looked past warnings that the brash former army captain could erode democracy, and embraced a chance for radical change after years of turmoil.

“I feel in my heart that things will change,” said Sandra Coccato, a 68-year-old small business owner, after she voted for Bolsonaro in Sao Paulo. “Lots of bad people are leaving, and lots of new, good people are entering. There’s a light at the end of the tunnel.”

Bolsonaro’s campaign first gained traction with his promises to go after violent crime in a country that leads the world in homicides and where many Brazilians live in daily fear of muggings or burglaries. However, his vows to loosen gun laws and give police a freer hand to use force against suspects also have raised concerns that a Bolsonaro presidency could lead to a bloody crackdown and an erosion of civil rights.

A woman donning the official Workers' Party color celebrates after voting in the presidential runoff election in Sao Paulo, Brazil, on Sunday.  (AP Photo/Nelson Antoine)

A woman donning the official Workers' Party color celebrates after voting in the presidential runoff election in Sao Paulo, Brazil, on Sunday.  (AP Photo/Nelson Antoine)

The campaign gained momentum by winning over much of the business community with promises of enacting market-friendly reforms that would reduce the size of the Brazilian state, including cutting ministries and privatizing state companies.

His divisive politics have heightened disharmony between Brazilians.

In Rio de Janeiro, his supporters set off fireworks on iconic Copacabana Beach. In Sao Paulo, Brazil’s largest city, cars horns could be heard honking and crowds celebrated as the results came in. In that same city, crowds gathered on a central avenue with banners and flags and people cheered and set off firecrackers in other neighborhoods as results came in.

MATTIS: U.S. MILITARY DEPLOYING RESOURCES TO MEXICO BORDER

Riot police separated supporters of Bolsonaro and those of his leftist rival Haddad when they briefly scuffled in Sao Paulo.

Bolsonaro went into the election the clear front-runner after getting 46 percent of the votes to Haddad’s 29 percent in the first round of the election Oct. 7.

After opinion polls in recent weeks had Bolsonaro leading by as much as 18 percentage points, the race had tightened in recent days. But Haddad was unable to make up the difference.

“I’m not crazy about Bolsonaro. But he is our way to keep the Workers’ Party out of office,” said Rafaela Rosa, a 32-year-old teacher, after voting Sunday in Sao Paulo. “We have had enough corruption and now we need to clean up.”

The Associated Press contributed to this report.