Tsunami waves have been confirmed off the southern coast of Mexico after a magnitude 8.1 earthquake struck shortly before midnight local time.
The Pacific Tsunami Warning Centre said waves of 3.3ft (1m) had been measured off the port of Salina Cruz.
Multiple aftershocks ranged between 4.5 and 5.7 in magnitude, the US Geological Survey said.
Mexican president Enrique Pena Nieto said the quake was the biggest his country had seen in a century.
The tremor has killed at least six people, including two children in the state of Tabasco.
Its governor, Arturo Nunez, said one was a baby who died at a children’s hospital which lost power, causing the infant’s ventilator to stop working.
Another four people were killed in neighbouring Chiapas state – among them two women who died in San Cristobal when a house and a wall collapsed.
“Homes, schools and hospitals have been damaged,” state governor Manuel Velasco said.
In Juchitan in Oaxaca state, parts of the town hall, plus other buildings including a hotel and a bar were reduced to rubble.
People in the capital, Mexico City, ran out into the street in their pyjamas after the tremor shook buildings.
Enrique Pena Nieto said a million people had initially been left without power, but 800,000 now had it back.
The quake struck at a depth of 43 miles (69 km), 76 miles (123 km) southwest of the town of Pijijiapan.
It poses a potential tsunami threat to the Pacific coastlines of countries including Guatemala, El Salvador, Costa Rica, Nicaragua, Panama and Honduras, the US Tsunami Warning System said.
Buildings in Guatemala were shaken by the tremor.
“I had never been anywhere where the earth moved so much,” said 31-year-old architect Luis Carlos Briceno, who is visiting Mexico City.
“At first I laughed, but when the lights went out I didn’t know what to do. I nearly fell over.”