The epicentre was in the east coast of Veracruz, where residents and tourists fled homes and hotels.
Authorities found no damage after reviewing the Laguna Verde nuclear power plant and oil installations in the Gulf of Mexico coast.
But the earthquake claimed one life in the neighboring southern state of Oaxaca.
A 75-year-old woman died after she fell and knocked her head on the floor when she was fleeing her home in the city of Oaxaca, said civil protection director Felipe Reyna Romero.
More From This Section
Walls and ceilings crumbled in the Oaxaca state cities of Tuxtepec and Loma Bonita, near the epicenter of the quake. Some hotels were evacuated in the city of Oaxaca, the state's namesake.
An explosion was reported in a mine further south in San Jose del Progreso but workers were safely evacuated, Reyna Romero said.
The US Geological Survey said the quake took place at 5:46 am (1046 GMT) in Veracruz, at a depth of 95 kilometers (59 miles) and 19 kilometres southwest of the municipality of Juan Rodriguez Clara.
Mexico City Mayor Miguel Angel Mancera said authorities reviewed the metropolis of 20 million people and found no damage or injuries.
Rosalinda Gonzalez, a 38-year-old secretary, fled from her apartment in her pajamas in downtown Mexico City.
"My daughter began to cry and when I got up I saw that it was shaking because her crib's mobile was moving by itself," she said.
Mexico is one of the most seismically active places in the world, sitting atop five tectonic plates, including three major ones.
In 1985, thousands of people were killed in the capital when buildings collapsed after an 8.1-magnitude quake struck the Pacific coast.