The epicentre was about 100km (62 miles) south-west of the town of Pijijiapan and at a depth of 35km, the United States Geological Survey said.
A tsunami warning has been issued for Mexico, Guatemala, El Salvador, Costa Rica, Nicaragua, Panama and Honduras.
The quake was felt in Mexico City, with buildings shaking and people running into the street.
One visitor to the city, Luis Carlos Briceno, told Reuters: "I had never been anywhere where the earth moved so much."
Some electricity cuts have been reported in the capital.
If confirmed at magnitude 8, the quake would be equal in strength to those that struck Mexico in 1995 and 1985. The latter hit close to Mexico City and caused thousands of deaths.
No tsunami warning has been issued for the US west coast in the latest quake.
Mexico is currently also being threatened on its eastern coast by Hurricane Katia.
The category one hurricane is about 300km south-east of Tampico and has sustained winds of 140km/h the National Hurricane Center says.