The epicenter was in the Pacific Ocean, some 600 miles (1,000 kilometers) southeast of the capital and 74 miles (120 kilometers) from the Pacific coast.
Mexican President Enrique Peña Nieto said the quake was the strongest earthquake Mexico has experienced in 100 years.
It hit late Thursday, when many people were asleep. The states of Chiapas and Oaxaca, home to about 9 million people, are located closest to the earthquake’s epicenter. They are two of the most impoverished areas in Mexico, and were likely hit the hardest.
So far, twenty-three people have been confirmed killed in Oaxaca state, seven in Chiapas state and two in Tabasco, local and federal officials said.