The 6.3-magnitude quake, hit at 23:32 GMT on Thursday, the National Seismological Service said. The epicenter was some 100 km off the coast of the fishing village of Zihuatanejo, about 160 km from Acapulco in the Pacific Coast state of Guerrero and some 400 km from Mexico City.
Two smaller, aftershock quakes were felt about 30 minutes later and then an hour later.
"That was pretty strong," said Luis Mario Farfan, who was at his taxi stance in central Mexico City when the first quake struck. "The electricity cables and the lamp-posts were swaying."
There were minor damage reports out of Guerrero state, with cracks appearing in the walls of some houses, according to local radio.
There were no immediate reports of damage or injuries in
Mexico City but some areas of the capital suffered power
cuts and buildings swayed, said Juan Jose Sanchez Perez, of the government's Civil Protection agency.
Local radio said cars pulled over to the side of the road to ride out the quake. Along Mexico City's central Reforma Avenue, where many of the city's taller buildings are located, people working on the 1 January holiday streamed out of their creaking offices.
The quake was felt to varying degrees across the city. "That is the first time I have felt two earthquakes in a row," said Arturo Janovitz, who was in his second-floor apartment in western Mexico City when the quake occurred.
"That was pretty strong. The electricity cables and the lamp-posts were swaying."
Luis Mario Farfan, a taxi driver
Seismological authorities did not say how long the earthquake lasted, but some Mexico City residents estimated it lasted over 45 seconds.
"It came in a circular motion, and it lasted forever," said Elvira Leyte, who was at home in the capital's central Roma neighbourhood during the earthquake.
Mexico City was hit by a massive earthquake that killed at
least 10,000 people in 1985. Since that disaster, the
metropolis has implemented some of Latin America's strictest
building codes to protect against quake damage.
At the beginning of 2003, a 7.9 magnitude earthquake killed
29 people in western Mexico but the capital escaped unscathed.