A 5.9-magnitude earthquake shook southern Mexico before dawn on Sunday (local time) and was felt as far away as Mexico City.
It prompted buildings to sway and some people to rush into the streets, but there were no immediate reports of damage.
The quake struck 29 kilometres northeast of the town of Pinotepa de Don Luis, in the southern Mexican state of Oaxaca, at a depth of 24.4 kilometres.
Luis Felipe Puente, the national head of emergency services, said on Twitter that there were no immediate reports of damage in much of southern Mexico, including the states of Puebla, Chiapas and Guerrero.
In a tweet, Mexico City Mayor Miguel Angel Mancera said there were no reports of damage or injuries in the city.