
President Claudia Sheinbaum was forced to evacuate the presidential palace during her regular morning press conference, along with the journalists in attendance, when the earthquake alert sounded.
They returned minutes later.
Sheinbaum said the earthquake’s epicenter was situated 15km from San Marcos, in the southern state of Guerrero. That is about 230km from Mexico City.
Sheinbaum said that preliminary reports indicated no serious damage in either Mexico City or Guerrero.
The US Geological Survey said the quake struck at 7.58 am local time.
The center of Mexico City is built on the muddy subsoil of what was once the bed of a lake, making it particularly vulnerable to earthquakes.
Those most strongly felt usually originate off Guerrero state on the Pacific coast.
On Sept 19, 1985, an 8.1 magnitude earthquake devastated a vast swathe of Mexico City, leaving nearly 13,000 dead, according to official figures.