Brazilians voted on Sunday in a bitterly contested election that pits a leftist president with strong support among the poor against a centrist senator promising pro-business policies to jumpstart a stagnant economy.
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 also has 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 at polling places.
Early results from state gubernatorial races gave a glimpse of how voters were leaning.
A Rousseff ally was heading to defeat in Rio Grande do Sul, the country's fifth largest electoral district, while a Neves ally had the upper hand in the midwestern state of Goias. Both results looked in line with recent polls.
The bitter presidential campaign has emphasized a clash between classes in a country still riven by inequality. Rousseff's team 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.