The quake, which struck the western state of Guerrero at 19:47 local time, was strongly felt in Mexico City.
At least two people have died in the state, but reports suggest the country has escaped major damage.
An 18-year-old man was killed when a roof collapsed in Iguala, a small city between the capital and the tourist resort of Acapulco.
A second man, aged 25 was killed when a rock fell on a small van on the Mexico City-Acapulco highway, according to Reuters news agency.
“I was dreadfully afraid, I thought it was never going to end,” Laura Gonzalez, who was in a bar in the capital at the time of the quake which lasted 40 seconds, told Reuters.
A severe earthquake in 1985 killed thousands of people and wrecked parts of Mexico City, and many residents live with the fear of a repeat.
Shoppers at a popular department store in Condesa rushed out to the street, some of them crying and shouting, and traffic lights were out at several intersections, causing traffic jams.
“The most damage was in Iguala because the epicenter was very close to there,” a spokesman for Guerrero emergency services told Reuters.
Power was knocked out in many districts of the capital and one building was evacuated, but Mexico City Mayor Marcelo Ebrard said water services,
the subway and the airport were working normally.
“The city center is fine, there are people skating on the ice rink,” Mexico City emergency services spokesman Manuel Mondragon said of the winter entertainment facility set up in the central Zocalo square.
“At the moment, there is no reason for concern,” he told Reuters.
A source from phone operator Telcel said services went out briefly in some sections of the city as the mobile network was overloaded with people trying to call family and friends.
iM21h-kJ8tQThe US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…