The U.S. Geological Survey said a magnitude-5.5 quake hit at 7:04 a.m. (9:04 a.m. EDT; 1304 GMT), centered about 10 miles (17 kilometers) west-southwest of Pinotepa Nacional on the Pacific Coast and 227 miles (365 kilometers) south-southeast of Mexico City.
Mexico Seismology Service initially calculated the quake's magnitude at 5.9.
A second quake struck near the same spot eight minutes later, also setting off alarms in the capital and causing people to evacuate tall buildings in the capital. The USGS calculated the magnitude of that quake at 5.1.
Mexico City's soft soil and geology make it especially sensitive to distant earthquakes. But Mayor Manuel Mancera said in a Twitter post that no damage was reported. Local news media also said there were no reports of damage close to Pinotepa Nacional.