With leftist Andres Manuel Lopez Obrador and conservative Felipe Calderon running neck-and-neck, the election, which will also pick both houses of congress and five governors, hinges on class divisions that have seldom been talked about so openly in Mexican politics.
For 71 years, until President Vicente Fox's victory in 2000, the Institutional Revolutionary Party, or PRI, ruled Mexico by claiming to represent all economic classes. Fox's victory ushered in full democracy and bettered life for the middle class but failed to create millions of jobs, tame Mexico's drug barons or settle its migrant-labor problems with the U.S.
Today, half of Mexico's 103 million people live on $4.50 a day and the poorest 20 million earn half that, a social and cultural gulf that has been the cornerstone of Lopez Obrador's campaign to succeed Fox, who is constitutionally barred from seeking-re-election.
The divide was on vivid display recently as his supporters cut through a swanky Mexico City shopping mall on their way to a campaign rally. Farming families who had never encountered escalators were hesitant to get on them, drawing disdainful looks from well-dressed onlookers.
This election boils down to a race between those strangers in the shopping mall and Mexicans who fear losing the low-interest loans and economic stability that emerged under Fox's disciplined budgets and high international reserves.
Santino Sanchez Juarez, 87, is one of the former. He barely survived doing odd jobs until Lopez Obrador, as Mexico City mayor, gave the elderly $65 monthly pensions.
"He is the only one with a heart, who cares for the people," said Sanchez Juarez.
He expressed a certain nostalgia for Adolfo Lopez Mateos who, as president from 1958 to 1964, used charisma, nationalism and populist handouts to the poor, but also crushed dissent and antagonized the United States.
Lopez Obrador shares that nostalgia, and his conservative opponent's campaign has been largely based on stoking fears that the left-winger is a clone of Hugo Chavez, Venezuela's Cuba-friendly president, and will foment class divisions while returning Mexico to the last debt-ridden years of PRI rule.
The PRI now looks like a spent force, with its candidate, Roberto Madrazo, trailing third in the polls, and Calderon's line of attack seems to have won some supporters.
Listening to Lopez Obrador, "It's almost as though, if you're not poor, he doesn't want to know about you," said Marisol Castro, 55, a middle-class nutritionist from the western city of Zamora.
Victory for Lopez Obrador would be a crowning moment for Latin America's left-wing renaissance, which has captured or held onto the presidency in Venezuela, Brazil, Bolivia, Chile and Argentina.
Lopez Obrador has sought to distance himself from the leftist surge, painting himself as a moderate with such benign slogans as "Happiness is on the way." But he also rails against "those on top," pledges to make the rich pay more taxes and wants to restore a sense of national pride, in part by standing up to the United States on issue such as farm trade.
His supporters sometimes heckle opponents' campaign events, cry conspiracy if polls show him faltering and pass out leaflets saying "only Lopez Obrador can win" fraught language in a country that fears violence if he is defeated.
The last polls all showed a statistically insignificant gap between the front-runners. First results will come in by about 9 p.m. EDT Sunday.
For all the divisions exposed in the campaign, there is much that all three candidates agree on. They advocate close U.S. ties and U.S. immigration reform that would allow more Mexicans to work legally north of the border. They all promise to crack down on crime, and Lopez Obrador has called for the army to play a greater role in fighting drug trafficking, a departure from the left's anti-military tradition.
"There are areas of the country that the government doesn't even control. The drug cartels control them, so we should give thanks if the Mexican government can recover its sovereignty," said Porfirio Munoz Ledo, a Lopez Obrador adviser. "If we can't do that, we won't have good relations with anybody abroad."
Some ghosts of the PRI years have been laid to rest. A stable economy has ended a history of boom-and-bust cycles, and a strong, respected election authority has made vote fraud and dirty tricks much harder to pull off.
But even if a candidate wins handsomely, he is unlikely to command a majority in the new Congress, and may face the same frustrations as Fox did in trying to get his more ambitious programs approved.
Calderon has offered almost as many giveaways as his allegedly free-spending opponent, but has also endorsed some of Fox's most exclusionary policies, such as a law that all but guarantees the stranglehold of a few large companies over the media sector.
Lopez Obrador's campaign has already absorbed some of the old-guard elements of the PRI by building a base of Mexico City government employees as well as beneficiaries of government programs, the kind of patronage machine that kept the PRI in power for decades.
"This is a choice between two clearly distinct proposals that differ over the central theme, which is inequality," said writer Carlos Monsivais. "That's the structural problem of this country."