Brazilians heading to polls in tense election as far right candidate favourite to win vote
Brazilians are weighing up 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 election campaign.
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, which he says could turn the country into Venezuela.
He has promised to turn the tide with use of force and clean governance.
Recent polls showed Mr Bolsonaro with an eight to 10 point lead over his rival, the leftist candidate Fernando Haddad, of the Workers' Party.
However, several key endorsements late on Saturday gave Mr Haddad's camp hope that they could still win.
"I am confident we can win," said Mr Haddad after voting at a school.
"There are many democratic voices that could have been silent and have spoken in our favour."
Mr 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 Brazilian supreme court, Jose Dias Toffoli, read out part of the country's 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," Mr Toffoli said, in remarks many took to be a rebuke of Mr Bolsonaro and his more extreme positions.
On Saturday, a popular former supreme court justice, Joaquim Barbosa, tweeted support for Mr Haddad, saying Mr Bolsonaro's candidacy scared him.
Likewise, former attorney general Rodrigo Janot, one of the biggest crusaders against corruption in Mr Haddad's Workers' Party in recent years, endorsed Mr 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.
Mr Neto said he was troubled by Mr 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," Mr Neto said on Twitter.
Mr Bolsonaro, a former army captain with a lacklustre 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 corruption scheme, known as "Carwash", and Mr Haddad has struggled to build momentum with promises of a return to the boom times by investing in health and education and reducing poverty.