Left-wing candidate Andrés Manuel López Obrador has claimed victory in Mexico's presidential election, saying "profound change" is coming.
The ex-Mexico City mayor, known by his initials Amlo, is projected to win about 53% and his rivals have conceded.
He vowed to tackle the "evil" of corruption, saying it had caused social inequality and violence in the country.
He also pledged to double pensions for the elderly and seek friendly ties with the United States.
Relations with Washington have been strained since the election of President Donald Trump, who has strongly criticised Mexico over trade and migration. Mr Trump sent a tweet of congratulations.
What has López Obrador said?
Late on Sunday, the 64-year-old promised to respect civil liberties and said he was "not looking to construct a dictatorship, either open or hidden".
Some opponents have expressed fears that his leftist and populist policies could damage the already sluggish economy and turn Mexico into "another Venezuela", which is suffering a deep economic crisis and rampant inflation.
Hailing a "historic night", Mr López Obrador called on all Mexicans to reconcile and repeated his campaign pledge to review energy contracts for signs of corruption.
"Corruption is... the result of a decadent political regime. We are absolutely convinced that this evil is the main cause of social and economic inequality, and also that corruption is to blame for the violence in our country," he said.
He has insisted that no-one involved in corruption will be spared, not even those he calls "brothers-in-arms".
So what are his other main policies?
On combating Mexico's record levels of violence, Mr López Obrador said he would have daily meetings with his security cabinet, which under him, he said, would be under a "unified command".
Sunday's election followed one of Mexico's deadliest campaigns in decades with more than 130 political candidates and party workers killed.
During the campaign Mr López Obrador had often used confrontational language when referring to Mr Trump, but struck a more conciliatory note in his victory speech, saying he would seek "friendly relations".
He also tried to reassure the business sector, saying there would be no nationalisation and that he would respect private business. He also said his government would be fiscally disciplined and taxes would not be raised.
On social policies, he said he would double pensions for the elderly upon taking office on 1 December as a first step to reducing Mexico's disparate income levels.
Andrés Manuel López Obrador - a brief biography
Born to a family of shopkeepers on 13 November 1953 in the rural community of Tepetitán, in southern Tabasco state
Known popularly as Amlo, which is an acronym using the full initials of his name
Elected Mexico City mayor in 2000
After losing the presidential elections in 2006 and 2012, he ran again this time under a three-party coalition led by the leftist National Regeneration Movement party (Morena) he founded in 2014
The self-styled anti-establishment figure has now ended the dominance of the PRI and PAN parties he called the "mafia of power
López Obrador, a winner at last
What have his rivals said?
The latest figures from the Mexican electoral institute show Mr López Obrador has won more than double the votes of his nearest challenger. It is the widest victory since the 1980s.
Ricardo Anaya, candidate for the conservative National Action Party (PAN), looked set to be runner-up to Mr López Obrador.
"I recognise his triumph, I express my congratulations, and I wish him the greatest success for the good of Mexico," Mr Anaya said.
Ruling party candidate José Antonio Meade, who lies in third place according to initial results, told supporters that he wished the winner "the greatest success".
Mr Meade's Institutional Revolutionary Party (PRI) has dominated Mexican politics for much of the past century but has slumped in popularity.
The electoral institute figures put official turnout at 62.7%. As well as a new president, 128 senators and 500 deputies in Congress were elected, in addition to state and local officials.