Mexico's old guard sailed back into power after a 12-year hiatus as the official preliminary vote count handed a victory to Enrique Peña Nieto, whose party was long accused of ruling the country through corruption and patronage.
The second-placed candidate, leftist Andres Manuel Lopez Obrador, refused to concede defeat, saying he would wait for a full count.
The Federal Electoral Institute's representative count said Mr Peña Nieto of the Institutional Revolutionary Party (PRI) won about 38% of the vote, prompting wild cheers from a group that was voted out in 2000 after 71 years in power when Mexicans became weary of what critics called autocratic and corrupt rule.
Mr Lopez Obrador of the Democratic Revolution Party had 31% and Josefina Vazquez Mota of the ruling National Action Party had about 25%, according to the institute.
Mr Peña Nieto called his victory "a fiesta of democracy".
"There is no return to the past," said the youthful, 45-year-old who is married to a soap opera star. "You have given our party a second chance and we will deliver results."
He promised a government that would be democratic, modern and open to criticism. He pledged to fight organised crime and said there would be no pacts with criminals. He added: "My gratitude tonight is for the millions of Mexican who voted for me. I will work for all of Mexico ... I will govern for everyone."
Despite a clear victory, more than 60% of voters did not support him and it was not the mandate the PRI had anticipated based on the pre-election polls.
Ms Vazquez Mota, 51, was the first to concede, followed by New Alliance candidate Gabriel Quadri, who had only single-digit support.
At the PRI headquarters in Mexico City, a fiesta atmosphere broke out with supporters in red dancing to norteño music.
There were plenty of reasons to celebrate. The party also appeared likely to retake at least one of the two houses of Congress and some governorships.
Critics said the party's 71-year rule was characterised by authoritarian and corrupt practices. But the PRI has sought to portray itself as a group that has been modernised and does not seek a return to its old ways.
Mr Lopez Obrador took hundreds of thousands of supporters to the streets in protest when he narrowly lost in 2006.
The PRI has been bolstered by voter fatigue due to a sluggish economy and the sharp escalation of a drug war that has killed roughly 50,000 Mexicans over the past six years.
Hugo Rubio, 33, a municipal employee in Nezalhualcoyotl, says what he expects is "more jobs, more tranquillity in terms of security" under Mr Peña Nieto.
"He has demonstrated that the party had changed, that he cares about the people who are most in need," Mr Rubio said as red-clad PRI supporters gathered with banners and balloons.
There were very few reports of problems during the vote, though some polling stations ran out of ballots and at least nine people were arrested in the southern state of Chiapas for trying to pass ballots pre-marked for the PRI.
Interior Secretary Alejandro Poire said that across the country federal security forces were working closely with local and state authorities, as well as electoral officials, to guard the peace during the vote.
Why are you making commenting on The Herald only available to subscribers?
It should have been a safe space for informed debate, somewhere for readers to discuss issues around the biggest stories of the day, but all too often the below the line comments on most websites have become bogged down by off-topic discussions and abuse.
heraldscotland.com is tackling this problem by allowing only subscribers to comment.
We are doing this to improve the experience for our loyal readers and we believe it will reduce the ability of trolls and troublemakers, who occasionally find their way onto our site, to abuse our journalists and readers. We also hope it will help the comments section fulfil its promise as a part of Scotland's conversation with itself.
We are lucky at The Herald. We are read by an informed, educated readership who can add their knowledge and insights to our stories.
That is invaluable.
We are making the subscriber-only change to support our valued readers, who tell us they don't want the site cluttered up with irrelevant comments, untruths and abuse.
In the past, the journalist’s job was to collect and distribute information to the audience. Technology means that readers can shape a discussion. We look forward to hearing from you on heraldscotland.com
Comments & Moderation
Readers’ comments: You are personally liable for the content of any comments you upload to this website, so please act responsibly. We do not pre-moderate or monitor readers’ comments appearing on our websites, but we do post-moderate in response to complaints we receive or otherwise when a potential problem comes to our attention. You can make a complaint by using the ‘report this post’ link . We may then apply our discretion under the user terms to amend or delete comments.
Post moderation is undertaken full-time 9am-6pm on weekdays, and on a part-time basis outwith those hours.
Read the rules hereComments are closed on this article