SAO PAULO - Brazilians on Sunday were weighing their hunger for radical change against fears that 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.

Far-right congressman Jair Bolsonaro has won over many voters by painting a picture of a Brazil at war — with criminals, corrupt politicians and leftist ideas that he says could turn the country into Venezuela — and promises to change the tide with force and clean governance.

Brazilians Weigh Change Versus Risk to Democracy in Election

Recent polls showed Bolsonaro with an 8 to 10 point lead over his rival, leftist candidate Fernando Haddad of the Workers’ Party. Several key endorsements late Saturday gave Haddad’s camp hope that they could still pull out a victory.

Brazilians Weigh Change Versus Risk to Democracy in Election

“I am confident we can win,” said Haddad after voting at a school. “There are many democratic voices that could have been silent and have spoken in our favor.” Supporters gathered in front and sang, “We can dream.”

Brazilians Weigh Change Versus Risk to Democracy in Election

Bolsonaro, meanwhile, made no comments to reporters when he voted at a military compound in Rio de Janeiro.

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.

On Saturday, a popular former Supreme Court justice, Joaquim Barbosa, tweeted support for Haddad, saying Bolsonaro’s candidacy scared him. Likewise, former Attorney General Rodrigo Janot, one of the biggest crusaders against corruption in Haddad’s Workers’ Party in recent years, endorsed Haddad for similar reasons.

One of the most important endorsements, particularly for young people, came from Youtuber Felipe Neto, whose channel has nearly 27 million followers.

Neto said he was troubled by Bolsonaro’s comments a week ago that “red” leftists would be run out of Brazil.

“In 16 years of the (Workers’ Party), I have been robbed, but never threatened,” Neto said by Twitter.

Bolsonaro, a former army captain with a lackluster record in Congress over 27 years, rose in prominence amid disgust with Brazil’s political system after a massive corruption scandal and a prolonged recession. In particular, many Brazilians are furious with the Workers’ Party for its role in the graft scheme, known as “Carwash” and Haddad has struggled to build momentum with his promises of a return to the boom times by investing in health and education and reducing poverty.

“If you have three crises happening at the same time — economic, political and moral, ethical in a way — I think you create a scenario which is perfect for outsiders and authoritarian, fringe candidates,” said Oliver Stuenkel, an associate professor of international relations at the Fundacao Getulio Vargas university in Sao Paulo. “It’s not unlikely that we’ll see an erosion of Brazil’s democracy. We’re already seeing it now.”

Many in Brazil and beyond have expressed concerns about a rollback of civil rights and a weakening of institutions in what remains a young democracy, especially since Bolsonaro has waxed nostalgic for Brazil’s 1964-1985 military dictatorship and said he would name military men to his Cabinet.

More than a dozen U.S. Democratic congressmen have written a letter urging Secretary of State Mike Pompeo to make clear that American aid to and cooperation with Brazil “is contingent on the upholding of basic human rights and democratic values by its leaders.”

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

That instability unleashed extreme anger with the political class but also revealed deep divisions in Brazilian society, and this campaign was the most polarized in decades. There were numerous reports of politically motivated violence, especially directed at gay people, whom Bolsonaro has disparaged. Bolsonaro himself was stabbed and almost died at a campaign event in early September.