He has promised to rejuvenate Mexico's economy
Leftist candidate Andres Manuel Lopez Obrador has won Mexico's presidential election with more than 50% of votes, according to an official quick count.
The former mayor of Mexico City has won between 53% and 53.8% of the vote, according to a projection by the National Electoral Institute, based on a sample of polling stations.
It gave Ricardo Anaya of the conservative National Action Party (PAN) between 22.1% and 22.8%, Jose Antonio Meade of the ruling Institutional Revolutionary Party (PRI) between 15.7% and 16.3%, and independent candidate Jaime Rodriguez between 5.3% and 5.5%.
Governing party candidate Mr Meade conceded the election, saying Mr Lopez Obrador bears the responsibility of the next government.
"For the good of Mexico, I wish him the very best of success," Mr Meade said.
Opposition candidate and conservative Ricardo Anaya has also congratulated Mr Lopez Obrador on his win.
Mr Anaya said in a televised speech that "the trend favours" Mr Lopez Obrador, adding: "I recognise his triumph".
The result is a shift to the left for Mexico and a big break with the PRI and PAN which, between them, have governed the country for nearly a century.
Mr Lopez Obrador (65) has promised to rejuvenate Mexico's economy.
He has vowed to transform Mexico, reduce its dependence on the US, rule for the poor and overthrow the "mafia of power" he says have looted the country.
US President Donald Trump tweeted his congratulations, and that he is looking "very much forward to working with him".
Congratulations to Andres Manuel Lopez Obrador on becoming the next President of Mexico. I look very much forward to working with him. There is much to be done that will benefit both the United States and Mexico!— Donald J. Trump (@realDonaldTrump) July 2, 2018
Mr Lopez Obrador enjoyed a wide lead in opinion polls throughout the campaign, his third for the presidency.