JUCHITAN: One of the most powerful earthquakes ever to hit Mexico was followed by a Gulf coast hurricane, dealing a one-two punch to the country that killed at least 63 people as workers scrambled Saturday to respond to the twin national emergencies.

The 8.1 quake off the southern Pacific coast just before midnight Thursday toppled hundreds of buildings in several states.

Hardest-hit was Juchitan, Oaxaca, where 36 people died and a third of the city's homes collapsed or were uninhabitable, President Enrique Pena Nieto said late yesterday in an interview with the Televisa news network.

Some were newly homeless, while others feared further aftershocks could topple their cracked adobe dwellings.

"We are all collapsed, our homes and our people," said Rosa Elba Ortiz Santiago, 43, who sat with her teenage son and more than a dozen neighbors on an assortment of chairs. "We are used to earthquakes, but not of this magnitude."

Even as she spoke, across the country, Hurricane Katia was roaring onshore north of Tecolutla in Veracruz state, pelting the region with intense rains and maximum sustained winds of 120 kph.

Veracruz Governor Miguel Angel Yunes said two people died in a mudslide related to the storm, and he said some rivers had risen to near flood stage, but there were no reports of major damage.

Veracruz and neighboring Puebla states evacuated more than 4,000 people ahead of the storm's arrival.

The Hurricane Center said Katia could still bring 3 to 6 inches (7.5 to 15 centimetres) of additional rain 25 to 37 centimetres) to a region with a history of deadly mudslides and flooding.

Pena Nieto announced yesterday that the earthquake killed 45 people in Oaxaca state, 12 in Chiapas and 4 in Tabasco, and he declared three days of national mourning. The toll included 36 dead in Juchitan, located on the narrow waist of Oaxaca known as the Isthmus, where a hospital and about half the city hall also collapsed into rubble.

Next to Ortiz, 47-year-old Jose Alberto Martinez said he and family members have long been accustomed to earthquakes.

So when the ground started moving, at first they simply waited a bit for it to stop until objects began falling and they bolted for the street.

"We felt like the house was coming down on top of us," Martinez said, accompanied by his wife, son and mother-in-law.

Now, he didn't feel safe going back inside until the home is inspected. Right next door, an older building had crumbled into a pile of rough timbers, brick and stucco, while little remained of a white church on the corner.

Rescuers searched for survivors yesterday with sniffer dogs and used heavy machinery at the main square to pull rubble away from city hall, where a missing police officer was believed to be inside.

The city's civil defense coordinator, Jose Antonio Marin Lopez, said similar searches had been going on all over the area.

Teams found bodies in the rubble, but the highlight was pulling four people, including two children, alive from the completely collapsed Hotel Del Rio where one woman died.

"The priority continues to be the people," Marin said.

Pena Nieto said authorities were working to re-establish supplies of water and food and provide medical attention to those who need it. He vowed the government would help rebuild.

"The power of this earthquake was devastating, but we are certain that the power of unity, the power of solidarity and the power of shared responsibility will be greater," Pena Nieto said.

Power was cut at least briefly to more than 1.8 million people, and authorities closed schools in at least 11 states to check them for safety.

The Interior Department reported that 428 homes were destroyed and 1,700 were damaged just in Chiapas, the state closest to the epicentre.

"Homes made of clay tiles and wood collapsed," said Nataniel Hernandez, a human rights worker living in Tonala, Chiapas, who worried that inclement weather threatened to bring more structures down.

"Right now it is raining very hard in Tonala, and with the rains it gets much more complicated because the homes were left very weak, with cracks," Hernandez said by phone.

The earthquake also jolted the Mexican capital, more than 1,000 kilometers away, which largely lies atop a former lakebed whose soil amplifies seismic waves.

Memories are still fresh for many of a catastrophic quake that killed thousands and devastated large parts of the city in 1985.

Mexico City escaped major damage, though part of a bridge on a highway being built to a new international airport collapsed due to the earthquake, local media reported.

The quake's power was equal to Mexico's strongest in the past century, and it was slightly stronger than the 1985 quake, the US Geological Survey said. However its impact was blunted somewhat by the fact that it struck some 100 miles offshore.

The epicentre was in a seismic hotspot in the Pacific where one tectonic plate dives under another. Such subduction zones are responsible for some of the biggest quakes in history, including the 2011 Fukushima disaster and the 2004 Sumatra quake that spawned a deadly tsunami.

In the Gulf coast state of Veracruz, tourists abandoned coastal hotels as winds and rains picked up ahead of Hurricane Katia's landfall and workers set up emergency shelters.

"The arrival of #Katia may be particularly dangerous for slopes affected by the earthquake. Avoid these areas," Pena Nieto tweeted.