Mexico's presidential vote was thrown into turmoil late Sunday, with both leftist Andres Manuel Lopez Obrador and conservative Felipe Calderon claiming victory as election officials announced that the two men were separated by a razor-thin margin.
The Federal Election Institute said the result would not be known until Wednesday and that the margin between the two leading candidates would probably be less than a percentage point.
Electoral institute President Luis Carlos Ugalde announced that a "quick count" based on a sample of the votes from about 7% of the precincts had produced a result within the margin of error. Only a full count of the more than 40 million estimated votes could determine the winner, he said.
Lopez Obrador nonetheless announced victory, soon followed by Calderon. Both said late Sunday that their own data showed them winning.
The leftist candidate told supporters late Sunday that the government wanted to cheat him out of a larger victory. "I want to inform the people of Mexico that according to our calculations we have won the presidency," Lopez Obrador said. The final difference, he said, would be 500,000 votes.
Calderon appeared moments later, to say that numerous private exit polls showed he would win. "Today the trends announced by several firms ... show that we have won the presidential elections," he said.
Lopez Obrador supporters gathered in the Zocalo, this city's central square, and shouted, "Fraud! Fraud!" Calderon backers at his National Action Party headquarters chanted, "We did it! We did it."
President Vicente Fox called for calm.
"The citizens can have the full certainty, the confidence, that all the votes will be counted and respected," Fox said in a nationally televised address moments after election officials announced their finding.
Early this morning, with 66% of polling stations counted, Calderon's ever-narrowing margin over Lopez Obrador had fallen to 1.2 percentage points.
In the coming days, the muddied result is sure to provide a stern test for Mexico's democratic institutions, which are still struggling to emerge from a long history of corruption and authoritarianism.
Lopez Obrador's statements seemed to play to the worst fears of his supporters, who have long seen themselves as victims of political shenanigans.
"It's difficult to see the elections be manipulated," said Veronica Martinez, who had gathered with a crowd to celebrate what they believed was a Lopez Obrador victory. "This seems like something out of the past."
The election was seen by many as a referendum on the open-market policies embraced by Fox. Dozens of labor unions and leftist groups supported Lopez Obrador of the Democratic Revolution Party, or PRD.
Roberto Madrazo, the candidate of the Institutional Revolutionary Party, or PRI, was expected to finish a distant third. His party, which monopolized power for 71 years, faced the prospect of becoming the smallest bloc in Congress.
More than 40 million people, or about 60% of the electorate, are believed to have cast ballots, according to the Federal Election Institute. More than 130,000 polling places had been set up, from within yards of the U.S. border in Tijuana, to Indian villages in Chiapas.
The campaign was one of the most acrimonious in Mexican history, with the three leading candidates spending millions on television and radio commercials attacking their opponents.
"I have to vote because it's a duty," said Cleofas Chavez Rodriguez, a 66-year-old resident of San Salvador Atenco, just outside of this capital city. "Of the three, none of them convinced me because they attacked each other so much."
Calderon, 43, ran as the candidate who would best continue economic policies initiated by Fox, who is limited by the constitution to a single, six-year term.
Lopez Obrador, 52, the charismatic former mayor of Mexico City, held a slight lead in most polls. He promised to expand subsidies to the needy and to stimulate the economy with public works projects and reductions in fuel prices.
The campaign slogan of Lopez Obrador's leftist coalition was a succinct, populist message: "For the Good of Everyone, the Poor First."
"We agree a lot with Lopez Obrador because he fights for the poor and the marginalized," said Manuel de Jesus De Lucio, a 50-year-old farmer who cast his vote in a polling booth in an open field in Mexico state.
If Lopez Obrador wins, Mexico would become the latest in a series of Latin American countries, including Brazil, Argentina, Venezuela, Bolivia, Peru and Chile, to elect left-of-center presidents in recent years.
Lopez Obrador promised to renegotiate certain provisions of the North American Free Trade Agreement that opened Mexican markets to U.S. and Canadian imports, and his victory could dramatically alter this country's relationship with the U.S.
Nationwide, only eight polling places failed to open, the best performance ever by Mexico's electoral system, officials said.
Business student Antonio Santiago, 24, was voting for the first time. "I'm voting so that there's democracy," Santiago said at a polling place just outside Mexico City. "So that democracy lives on."
Sunday's vote was also to elect a new Congress -- 500 members of the Chamber of Deputies and 128 in the Senate.
No party holds a majority in either house, a state of affairs expected to remain unchanged after Sunday's vote.
Exit polls agreed that the PRI would fall from the being the largest to the third-largest party in Congress. Early results showed the PRI, for the first time in its history, would not carry a single state in the presidential election.
"The collapse of the PRI is one of the big stories of the night," said Pamela Starr of the Eurasia Group, a risk analysis firm. "It's much larger than we expected."
There were some scattered allegations of the kinds of voting irregularities that were common in Mexico's recent past. PRD officials reported that two party activists were killed in the southern state of Guerrero, in a Pacific Coast region beset by drug violence. Election officials said later the killings appeared to be the result of an attempted robbery.
Mexican citizens living in the U.S. were turned away by the hundreds after crossing the border to vote at special polling places that were allocated only 750 ballots each, news services reported.
In Oaxaca, groups of striking teachers surrounded a police station, alleging that officers inside had stacks of ballots pre-marked with votes for the candidates backed by PRI Gov. Ulises Ruiz, news agencies reported. For weeks, teachers have led a protest movement against Ruiz.
The most common complaint was one voiced by voters in many Mexico City neighborhoods: lines outside polling places stretched for blocks.
"I've been here for more than an hour, and I haven't advanced one meter," said Raul Cordero Lopez, a 42-year-old engineer, as he stood in a line with hundreds of voters in southern Mexico City. "It's totally disorganized. The poll workers got here late."
The new president will take the oath of office Dec. 1. Whoever is elected will have to deal with many of the political challenges faced by Fox, who proved unable to pass many legislative proposals, including a tax overhaul.
Since 2003, when he held a referendum in which Mexico City residents voted overwhelming to keep him in office, Lopez Obrador has been widely considered to be the favorite in the presidential race. But he had to fight off an effort last year to have him impeached, which also would have prevented him from running for president.
The Fox administration sought to prosecute Lopez Obrador on an obscure charge related to the construction of a local hospital. Congress impeached him, stripping him of his immunity.
But the charges were dropped after hundreds of thousands of demonstrators took to the streets of Mexico City. Lopez Obrador returned to office and his popularity soared.
Calderon, a former energy secretary under Fox who won his party's nomination in October, trailed Lopez Obrador until March, when he launched what was arguably the most sophisticated media campaign Mexican politics has seen.
In more than a dozen commercials, the Calderon campaign portrayed Lopez Obrador as a demagogue and spendthrift who would bring back the hyperinflation and dramatic currency devaluations of the 1980s and early 1990s.
On Sunday, many Calderon supporters echoed those arguments. "I hope Felipe Calderon wins because he will give more stability and security to all of those who want to live in a country that has prosperity, without any crisis," said Linda Claussen, a 39-year-old restaurant owner here. "I think Lopez Obrador is a danger to Mexico."
By April, Calderon surged into a narrow lead in most polls.
But Lopez Obrador revived his campaign with allegations of corruption against a firm owned by Calderon's brother-in-law. Calderon denied the charges.
The controversy helped propel the former mayor back into the lead in most polls.
Times staff writers Sam Enriquez, Richard Boudreaux, Carlos Martinez and Cecilia Sanchez in Mexico City contributed to this report.