Mexico's old ruling party, the PRI, is set to return to power as early official results indicate its candidate Enrique Pena Nieto has won the presidential election.
Pena Nieto, 45, is on some 38%, several points ahead of Andres Manuel Lopez Obrador, who has not conceded.
Thousands of police were on duty for the vote, amid fears of intimidation from drug gangs.
Mexicans were also electing a new congress and some state governors.
Celebrations at the headquarters of the PRI started after the polls closed.
Pena thanked Mexican voters for giving the PRI a second chance, saying his administration would have a "new way of governing".
The election campaign was dominated by the economy and the war on drugs.