Millions of Brazilians vote on Sunday, choosing between two very different politicians to be their next president.
Far-right candidate Jair Bolsonaro faces leftist Fernando Haddad of the Workers’ Party in the second and final round of presidential elections.
While polls have been narrowing, Mr Bolsonaro remains in the lead.
The election has been over-shadowed by corruption scandals and a knife attack on Mr Bolsonaro in which he lost 40% of his blood and needed emergency surgery.
Jair Bolsonaro, a 63-year-old former army captain is from the small, conservative Social Liberal Party. His provocative statements on abortion, race, migration, homosexuality and gun laws have earned him the nickname “Trump of the Tropics”.
- Jair Bolsonaro: Trump of the Tropics?
- Fernando Haddad: The man in Lula’s mantle
Fernando Haddad, a 55-year-old former São Paulo mayor and education minister, is the son of a family of Lebanese immigrants.
He replaced former President Luiz Inácio Lula da Silva, currently serving a 12-year prison sentence on corruption charges, as the presidential candidate for the Workers’ Party less than a month before the first round of the election.
Two final opinion polls released on Saturday showed that support for Mr Haddad had increased, though Mr Bolsonaro was still expected to win about 55% of the vote.
“This thing is going to turn around,” Mr Haddad told supporters at his final campaign rally.
Mr Bolsonaro made his final pitch on social media. He has not campaigned in public since he was stabbed in the stomach at a rally in September, sending him to the hospital for three weeks.
“God willing, tomorrow will be our new independence day,” he tweeted.
At the scene: BBC South America Correspondent Katy Watson
We have spent the day at a couple of voting centres in Rio. The first was in the upmarket neighbourhood of Leblon, next to the iconic Ipanema beach. There were quite a few people dressed in the “colours” of their candidate – green, blue and yellow in support of Jair Bolsonaro or red for those voting for Fernando Haddad.
Most voters came and went in peace but a group of Bolsonaro supporters started heckling those voting for Haddad.
“Go to Venezuela you socialists,” they shouted at those supporting the Workers’ Party.
At the voting centre in Rocinha, a poor neighbourhood, very few displayed their political allegiances. Hardly anyone would talk to us, hesitant to declare their vote. There has been so much anger and division in these elections – and the tension just continues to build.
Brazil has been rocked by an increase in violent crime and a huge political bribery scandal that has tainted the entire political class. The economy shrank by nearly 7% during the country’s worst-ever recession in 2015.
Voting is mandatory for the country’s 147 million eligible voters, with results expected around 22:00 GMT.
In London, demonstrators for and against Mr Bolsonaro turned up outside the embassy near Trafalgar Square as Brazilians in the UK queued up to vote.
The winner will replace President Michel Temer from the conservative Brazilian Democratic Movement Party (MDB), who leaves office with an approval rating of just 2%.