Brazilian voters go to the polls on Sunday in a tense election to choose between re-electing far-right President Jair Bolsonaro or returning leftist former President Luiz Inacio Lula da Silva to office.
The tight race offers a second chance for both candidates.
Bolsonaro has vowed to consolidate a sharp conservative turn in Brazilian politics after a presidency marred by the pandemic. Lula promises more social and environmental responsibility, recalling the rising prosperity of his 2003-2010 presidency, before corruption scandals tarred his Workers Party.
Some 120 million voters are expected to punch their choices into electronic voting machines that Bolsonaro has criticized without proof as fraud-prone, raising concern he may not concede defeat, following the example of ideological ally, former U.S. President Donald Trump.
That has added to tensions in the Brazil's most polarizing election since its return democracy in 1985 after a military dictatorship that Lula, a former union leader, rallied against and Bolsonaro, a former army captain, invokes with nostalgia.
Several polls showed the race between them tightening in the final week, with Bolsonaro eroding a slight lead for Lula. Others show a small but steady advantage for Lula.
Bolsonaro outperformed opinion polls in the first round of voting on Oct. 2 among a field of 11 candidates. Pollsters said they recalibrated their methods based on that result, but most analysts still say Sunday's runoff could go either way.
A victory for Lula would mark a stunning comeback for the leftist leader, who was jailed in 2018 for 19 months on bribery convictions that the Supreme Court overturned last year, clearing the way for him to seek a third presidential term.
Lula has vowed a return to state-driven economic growth and social policies that helped lift millions out of poverty during a commodity boom when he first governed Brazil. He also vows to combat destruction of the Amazon rainforest, now at a 15-year high, and make Brazil a leader in global climate talks.
A second term for Bolsonaro would keep Brazil on a path of free-market reforms and looser environmental protections, while cementing a coalition of right-wing parties and powerful farm interests, which bankrolled his campaign.
Brazil's electoral authorities are preparing for a narrow result, which Bolsonaro may contest if he loses.
The president has spent more than a year questioning the reliability of Brazil's electronic voting system. Although there has been no evidence of fraud since it was implemented in 1996, many of Bolsonaro's supporters now doubt the credibility of the country's elections.
A rising tide of political violence this year, punctuated in recent weeks by armed confrontations involving high-profile Bolsonaro allies, has added to fears that contested election result could trigger unrest.
The Superior Electoral Court (TSE), led by justices from the Supreme Court, has devised a security plan to protect its staff and buildings in the event of demonstrations like the January 2021 assault on the U.S. Capitol.
Bolsonaro's allies are organizing a "Victory Party" on Brasilia's central esplanade on Sunday during the vote count.
The president has also asked supporters to stick around voting stations until they close at 5 p.m. (2000 GMT) on Sunday, which critics say could intimidate voters and lead to clashes.
Lula, who was born into poverty and led union strikes against Brazil's military government before founding the Workers Party in the 1980s, has called on voters to defend Brazil's democracy from Bolsonaro's "neofascism."
Adding to the climate of uncertainty, Bolsonaro has pushed the military to publicly endorse his theory that the voting system is vulnerable to fraud.
The armed forces checked some voting machines during the first-round vote to be sure paper receipts lined up with the results transmitted digitally, but they did not report their findings.
Retired army generals have told Reuters they trust the armed forces would not back any unconstitutional moves by Bolsonaro.