MEXICO CITY • Mr Andres Manuel Lopez Obrador has won Mexico's presidency in a landslide victory, riding a public revolt against rampant crime, corruption and poverty.
The result sets the stage for the most left-wing government in the country's democratic history at a time of tense relations with the US administration.
The earliest figures announced by the electoral board on Sunday gave Mr Lopez Obrador, 64, about 53 per cent of the vote.
Mr Ricardo Anaya, 39, leader of a right-left coalition, had about 22 per cent and Mr Jose Antonio Meade, 49, the candidate of the incumbent Institutional Revolutionary Party, took 16 per cent.
Long before those official results began to emerge, exit polls showed Mr Lopez Obrador so far ahead of his two main rivals that they conceded defeat - and congratulations had begun to pour in from foreign leaders, including Mr Donald Trump.
"I look very much forward to working with him," the US President, who has repeatedly lambasted Mexico for sending illegal migrants and drugs across the border, tweeted.
In a televised address later on Sunday, Mr Lopez Obrador promised "deep changes" and said that while he will respect all Mexicans, "we'll give preference to the poorest, and to the forgotten".
ANDRES MANUEL LOPEZ OBRADOR
RICARDO ANAYA (above)
JOSE ANTONIO MEADE (above)
But he made a point of allaying market concerns too, promising to respect the central bank's autonomy, avoid raising taxes in real terms, and stay within "legal channels" as he reviews oil deals approved under the outgoing President Enrique Pena Nieto.
He then headed for Mexico City's historic centre, where a huge crowd of jubilant supporters was waiting for him.
"We'll fulfil all our promises," he told them. "We won't fail you."
Defeated in the last two presidential votes, Mr Lopez Obrador now has a mandate unmatched by recent Mexican leaders to take the country in a new direction.
He has promised to govern as a pragmatist, and says he will not nationalise companies, or quit the North American Free Trade Agreement which his country has been renegotiating with the United States and Canada.
Still, his procession towards victory has alarmed many investors and business leaders. They worry that the privatisation of the energy industry will be rolled back, and expanded social programmes will push the country into debt.
Mr Lopez Obrador has said his plans can be funded without deficit spending, with the money saved by eliminating graft. Economists are sceptical. And looming over Mexico's sea-change is the spectre of left-populist governments, from Brazil to Venezuela, that ran their economies into the ground.
"This will be a new era," said Mr Alonso Cervera, chief Latin America economist at Credit Suisse. "The continuity of the economic model is in question."
The current model, overseen by US-educated technocrats and centred on tight budgets and foreign trade, has won investment-grade credit ratings for Mexico. It has been less successful at delivering growth in the US$1.2 trillion (S$1.6 trillion) economy, or higher living standards for ordinary Mexicans.
About half of the country's 125 million population live in poverty. They are Mr Lopez Obrador's base - and they will be expecting concrete material benefits after he takes office in December.
He has said he wants to make Mexico more economically independent of the US. At the same time, he also hopes to persuade Mr Trump to help develop Mexico and Central America in order to contain illegal migration.
Mr Andrew Selee, president of the Migration Policy Institute in Washington, said the change in leadership means "the US can't take Mexico for granted any more".
"Lopez Obrador will be pragmatic... but he's not going to bend over backwards to have a good relationship."