You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
Polls on the eve of the vote gave a slight edge to incumbent Dilma Rousseff, who is seeking a second four-year term. Her Workers' Party has held power for 12 years and leveraged an economic boom to expand social welfare programs and lift over 40 million people from poverty.
But many voters, especially upper-middle class Brazilians in major cities, believe former state governor Aecio Neves offers new hope for Latin America's biggest economy, which has flagged under Rousseff and entered a recession earlier this year.
Brazil's most competitive presidential campaign in decades has also been the most acrimonious in recent memory, dominated by attack ads and a steady drum beat of corruption allegations.
The race looks like a choice between two camps: those who feel they are better off after more than a decade of Workers' Party rule or those who believe Brazil is stuck in a rut.
"We need change ... The president's projects are unfinished and inflation is sky high," said Maria Luiza de Carvalho, a university professor in the Amazonian capital of Manaus. "I think Aecio has guts - and it can't get worse than it is."
Rousseff, 66, voted early in the southern city of Porto Alegre, where she lived and rose in the state bureaucracy in the 1990s. She has promised to deepen flagship welfare programs and restore growth with a new economic team.
Neves, 54, says he will keep the popular social benefits while reining in other forms of public spending. He plans to take a tougher stance against inflation and give the central bank more autonomy to set monetary policy.
Accompanied by his wife, a former model, Neves cast his ballot in Belo Horizonte, where he served as governor of Minas Gerais state for eight years. He left office with high approval ratings after tough spending cuts balanced the state budget.
Voting went smoothly at electronic polls across three time zones, from far-flung Amazon villages to Sao Paulo's business district. There were some arrests for minor offences such as distributing election propaganda or illegal exit surveys at polling places.
Casting a ballot is mandatory for Brazilians between the ages of 18 and 70 and more than 140 million are registered to vote.
The bitter campaign has emphasized a clash between classes in a country still riven by inequality. Rousseff's team relentlessly portrayed Neves, a third-generation politician, as a heartless playboy with little concern for the poor.
The final two opinion polls on Saturday showed Rousseff as a slight favorite, with a lead of 4-6 percentage points. But one of them also showed Neves pulling ahead in Minas Gerais, a bellwether state every victorious presidential candidate has won since Brazil's return to full democracy in 1989.
Pollsters faced widespread criticism for failing to predict Neves' strong showing in the first round of voting on Oct. 5, when he surged from a distant third place in polls to clinch second place and a spot in the runoff.
If the vote were about the economy alone, Rousseff would have a hard time winning.
As demand for Brazil's vast natural resources cooled in recent years, her administration has been unable to revive growth. That has strained a government model that relied on soaring tax revenues to fuel social programs and pump subsidized credit through state lenders, juicing a consumer boom.
The economy, which fell into recession in the first half of the year, has grown by less than 2 percent annually on Rousseff's watch. Investment has sagged and inflation, a chronic problem throughout Brazilian history, is running just over the government's official tolerance limit of 6.5 percent.
Although unemployment remains at historic lows, economists see few bright spots on the horizon.
Meanwhile, a corruption scandal at the state-run oil giant Petrobras dominated the national media over the weekend. The case has hurt Rousseff's reputation as a competent manager because she once chaired the company's board and as president she appoints senior executives.
Weekly news magazine Veja reported on Friday that a jailed black market money dealer, Alberto Youssef, told police and prosecutors that Rousseff and her predecessor, Luiz Inacio Lula da Silva, knew about an alleged bribery scheme at Petrobras funneling cash to the Workers' Party and its allies.
Rousseff has vehemently denied the Veja report and says it is part of a smear campaign against her candidacy.
In a televised debate with Rousseff on Friday, Neves said Brazilians could end corruption with one measure: "Get the Workers' Party out of office."
Still, his plea is likely to fall on deaf ears among the roughly 40 percent of voters who believe the ruling party has helped them lead more prosperous lives and feel that Neves does not represent them.
Luis Resende de Assis, 33, said voting for Rousseff would ensure a bright future for his children.
"What's at stake is the chance for them to study the way I did, getting a doctorate abroad without coming from the upper class," he said in Brasilia, the capital.