President Claudia Sheinbaum was forced to evacuate the presidential palace during her regular morning press conference.
Mexico’s National Seismological Service said the earthquake’s epicentre was situated 14km southwest of the town of San Marcos in the state of Guerrero.
Sheinbaum said there were no immediate reports of major damage, but in San Marcos the effects were visible.
A woman in her 50s “lost her life when her house collapsed on top of her”, said Guerrero Governor Evelyn Salgado.
San Marcos Mayor Misael Lorenzo Castillo said about 50 houses were destroyed and “all the houses have cracks”.
Residents showed an AFP journalist the cracks in the walls of their homes and sections of collapsed walls.
“San Marcos has been badly affected, devastated,” said Rogelio Moreno, a resident, standing in front of his damaged home.
‘Woke in terror’
Mexico, which is situated between five tectonic plates, is one of the world’s most seismically active countries.
Karen Gomez, a 47-year-old office worker living on the 13th floor of an apartment building in Mexico City’s southwestern Alvaro Obregon borough, told AFP she was roused from her sleep by a street siren.
“I woke up in terror. My cell phone alert said it was a powerful earthquake.”
Norma Ortega, a 57-year-old kindergarten director, living in a 10th-floor apartment, said she could feel her building shake.
In Acapulco, Ricardo, a tourist from the central Mexican state of Morelos, fled his hotel shirtless after sirens sounded.
The centre of Mexico City is built on the muddy subsoil of what was once the bed of a lake, making it particularly vulnerable to earthquakes.
Loudspeakers on lamp-posts
The quakes most strongly felt usually originate off Guerrero state on the Pacific coast.
On September 19, 1985, an 8.1-magnitude earthquake devastated a vast swathe of Mexico City, leaving nearly 13,000 dead, mostly in the city, according to official figures.
In 2017, also on September 19, a 7.1-magnitude quake killed 369 people, also mostly in Mexico City.
Early warning systems, including smartphone apps, have been developed to warn citizens of strong quakes and urge them to reach safety.
Mexico City has also installed loudspeakers on lamp-posts to broadcast the alerts.
– Agence France-Presse