Mexico City Mayor Miguel Angel Mancera reported via his Twitter account that there were no early reports of damage.
The U.S. Geological Survey said the quake had a preliminary magnitude of 5.8 and struck at 12:19 a.m. local time Sunday (0519 GMT) about 122 kilometers (76 miles) south of the Mexican capital. The epicenter was 22 kilometers (14 miles) west of the town of Jolalpan in Puebla state. It had a depth of 54 kilometers (33 miles).
Mancera said electrical service had gone out in parts of the city, and that it was being attended to.
The epicenter was in Guerrero state near the border of Puebla. The governors of both states also reported no early indications of damage.