The race pits incumbent President Jair Bolsonaro against his political nemesis, former President Luiz Inacio Lula da Silva. There are nine other candidates, but their support pales to that for Bolsonaro and da Silva.
Recent opinion polls have given da Silva a commanding lead, the last Datafolha survey published Saturday found a 50 percent to 36 percent advantage for da Silva among those who intended to vote. It interviewed 12,800 people, with a margin of error of two percentage points.
Agatha de Carvalho, 24, arrived to her local voting station in Rio de Janeiro's working class Rocinha neighborhood shortly before it opened, hoping to cast her ballot before work, but found 100 others were already lined up. She said she would vote for da Silva, and called Bolsonaro "awful.''
"A lot of people died because of him during the pandemic. If he hadn't done some of the things he did, some of those deaths could have been avoided,'' she said.
Bolsonaro's administration has been marked by incendiary speech, his testing of democratic institutions, his widely criticized handling of the COVID-19 pandemic and the worst deforestation in the Amazon rainforest in 15 years.
But he has built a devoted base by defending traditional family values, rebuffing political correctness and presenting himself as protecting the nation from leftist policies that infringe on personal liberties and produce economic turmoil.
Luiz Garcez, 49, in the southern city of Curitiba, said Bolsonaro's presidency has been "among the best in history'' because "he built a lot and helped the country.''
A slow economic recovery has yet to reach the poor, with 33 million Brazilians going hungry despite higher welfare payments. Like several of its Latin American neighbors coping with high inflation and a vast number of people excluded from formal employment, Brazil is considering a shift to the political left.
Gustavo Petro in Colombia, Gabriel Boric in Chile and Pedro Castillo in Peru are among the left-leaning leaders in the region who have recently assumed power.
Da Silva could win in the first round, without need for a run-off on Oct. 30, if he gets more than 50 percent of valid votes, which exclude spoiled and blank ballots. Brazil has more than 150 million eligible voters, and voting is mandatory, but abstention rates can reach as high as 20 percent.
An outright win by da Silva would sharpen focus on Bolsonaro's reaction to the count. He has repeatedly questioned the reliability not just of opinion polls, but also of Brazil's electronic voting machines. Analysts fear he has laid the groundwork to reject results.
At one point, Bolsonaro claimed to possess evidence of fraud, but never presented any, even after the electoral authority set a deadline to do so. He said as recently as Sept. 18 that if he doesn't win in the first round, something must be "abnormal.''
The two frontrunners have key bases of support: evangelicals and white men for Bolsonaro, and women, minorities and the poor for da Silva.
Da Silva, 76, was once a metalworker who rose from poverty to the presidency and is credited with building an extensive social welfare program during his 2003-2010 tenure that helped lift tens of millions into the middle class.
But he is also remembered for his administration's involvement in vast corruption scandals that entangled politicians and business executives.
Da Silva's own convictions for corruption and money laundering led to 19 months imprisonment, sidelining him from the 2018 presidential race that polls indicated he had been leading against Bolsonaro. The Supreme Court later annulled da Silva's convictions on the grounds that the judge was biased and colluded with prosecutors.
Marialva Santos Pereira, 47, said she would vote for the former president for the first time since 2002.
"I didn't like the scandals in his first administration, never voted for the Workers' Party again. Now I will, because I think he was unjustly jailed and because Bolsonaro is such a bad president that it makes everyone else look better.''
Speaking after casting his ballot in Sao Bernardo do Campo, the manufacturing hub in Sao Paulo state where he was a union leader, da Silva recalled that four years ago he was imprisoned and unable to vote.
"I want to try to make the country return to normality, try to make this country again take care of its people,'' he told reporters.
Bolsonaro grew up in a lower-middle-class family before joining the army. He turned to politics after being forced out of the military for openly pushing to raise servicemen's pay. During his seven terms as a fringe lawmaker in Congress' lower house, he regularly expressed nostalgia for the country's two-decade military dictatorship.
His overtures to the armed forces have raised concern that his possible rejection of election results could be backed by top brass.
Traditionally, the armed forces' involvement in elections has been limited to carrying voting machines to isolated communities and beefing up security in violent regions. But this year, Bolsonaro suggested the military should conduct a parallel count of the ballots.
While that didn't materialize, the Defense Ministry said it will cross check results in over 380 polling stations across Brazil. Any citizen or entity is able to do the same, consulting a vote tally available at each station after ballot closure and online.
On Saturday, Bolsonaro shared social media posts by right-leaning foreign politicians, including former U.S. President Donald Trump, who called on Brazilians to vote for him. Israel's former Prime Minister Benjamin Netanyahu expressed gratitude for stronger bilateral relations and Hungarian Prime Minister Viktor Orban also praised him.
After voting Sunday morning, wearing a T-shirt with the green and yellow of Brazil's flag, Bolsonaro told journalists that "clean elections must be respected'' and that the first round would be decisive. Asked if he would respect results, he gave a thumbs up and walked away.
Because the vote is conducted electronically, preliminary results are usually out within minutes, with the final result available a few hours later. This year, all polls will close at 5 p.m. Brasilia time (4 p.m. EDT; 2000 GMT).