The epicentre was located at a depth of 10 km, 38 km southeast of Union Hidalgo in the southern state of Oaxaca on the nation's Pacific coast, Mexico's Seismology Service reported in its Twitter account.
There have been no immediate reports about damage or casualties due to the earthquake.
Earlier, a 5.4 magnitude earthquake struck 119 kilometres south-west of the municipality of Suchiate, Mexico.