One of the most powerful earthquakes ever recorded in Mexico struck off the country's southern coast late Thursday, toppling buildings, triggering tsunami evacuations and sending panicked people fleeing into the streets in the middle of the night. At least 61 were reported killed.

The U.S. Geological Survey (USGS) said the earthquake hit off Chiapas state near the Guatemalan border with a magnitude of 8.1.

"The house moved like chewing gum, and the light and internet went out momentarily," said Rodrigo Soberanes, who lives near the Chiapas state city of San Cristobal de las Casas.

The extent of destruction was still emerging Friday. Hundreds of buildings collapsed or were damaged, power was cut at least briefly to more than 1.8 million people and authorities closed schools Friday in at least 11 states to check them for safety.

Mexico Earthquake

A dog sits atop of the rubble of a wall that collapsed in Mexico City during a massive earthquake, Friday, Sept. 8, 2017. (Marco Ugarte/Associated Press)

President Enrique Pena Nieto said Friday evening in a televised address that 61 people were killed — 45 in Oaxaca state, 12 in Chiapas and four in Tabasco — and he declared three days of national mourning.

The worst-hit city appeared to be Juchitan, on the narrow waist of Oaxaca known as the Isthmus. About half of the city hall collapsed in a pile of rubble and streets were littered with the debris of ruined houses.

Pena Nieto toured the area, where he met with residents amid the debris of crumbled buildings. 

"The priority in Juchitan is re-establishing supply of water and food, as well as medical attention for those affected," Pena Nieto said via Twitter.

Mexico Earthquake

A soldier walks by a partially collapsed structure in the town of Matias Romero, Oaxaca state, Mexico, on Friday. (Felix Marquez/Associated Press)

Tabasco Gov. Arturo Nunez said two children had died in his Gulf coast state. One of them was killed when a wall collapsed, and the other was a baby who died in a children's hospital that lost electricity, cutting off the infant's ventilator.

Chiapas Gov. Manuel Velasco called on people living near the coast to leave their houses as a protective measure.

"There is damage to hospitals that have lost energy," he said. "Homes, schools and hospitals have been damaged."

The Interior Department reported that 428 homes were destroyed and 1,700 were damaged in various cities and towns in Chiapas.

Hurricane Katia on the way

The furious shaking created a second national emergency for Mexican agencies already bracing for Hurricane Katia on the other side of the country. 

The U.S. National Hurricane Center said Hurricane Katia was likely to strike the Gulf coast in the state of Veracruz late Friday or early Saturday as a Category 2 storm that could bring life-threatening floods.

Mexico Tropical Weather

A man stands on the shore under an overcast sky before the arrival of Hurricane Katia, in Tecolutla, Veracruz state, Mexico, on Friday. (Eduardo Verdugo/Associated Press)

It said Katia had maximum sustained winds of 165 km/h and was located about 210 kilometres southeast of the city of Tampico in the evening.

In Veracruz, tourists abandoned coastal hotels as wind and rain picked up ahead of Katia's expected landfall. Workers set up emergency shelters and cleared storm drains, and forecasters warned that the storm threatened to bring torrential rainfall, high winds and a dangerous storm surge off the Gulf of Mexico. 

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

Repeated aftershocks

The U.S. Geological Survey said the quake struck at 11:49 p.m. local time Thursday and its epicentre was 165 kilometres west of Tapachula in Chiapas. It had a depth of 69.7 kilometres.

Dozens of strong aftershocks rattled the region in the following hours.

mexico-quake

Mexico quake map, Sept 8, 2017. (Reuters)

The quake caused buildings to sway violently in Mexico's capital more than 1,000 kilometres away. Mexico City escaped major damage, but the quake terrified sleeping residents, many of whom still remember the catastrophic 1985 earthquake that killed thousands and devastated large parts of the city.

A shrill seismic alarm sounded and as beds banged against walls, people still wearing pyjamas fled into the streets, gathering in frightened groups. 

Metre-high waves

The Pacific Tsunami Warning Center said waves of one metre above the tide level were measured off Salina Cruz, Mexico. Smaller tsunami waves were observed on the coast or measured by ocean gauges in several other places. The centre's forecast said Ecuador, El Salvador and Guatemala could see waves of up to a metre. No threat was posed to Hawaii and the western and South Pacific.

Mexico Earthquake

Evacuated patients lie on hospital beds at a sports venue used as shelter and a makeshift hospital in the aftermath of a massive earthquake, in Juchitan, Oaxaca state, on Friday. (Luis Alberto Cruz/Associated Press)

Mexican authorities said they were evacuating some residents of coastal Tonala and Puerto Madero because of the warning.

In neighbouring Guatemala, President Jimmy Morales spoke on national television to call for calm while emergency crews checked for damage.

"We have reports of some damage and the death of one person, even though we still don't have details," Morales said. He said the unconfirmed death occurred in San Marcos state near the border with Mexico.

The quake occurred in a very seismically active region near the point of collision between three tectonic plates, the Cocos, the Caribbean and the North American.

Mexico's National Seismological Service said the area has seen at least six other quakes of magnitude 7.0 or greater since 1900 — though three of those all occurred within a nerve-wracking nine-month span in 1902-1903.

Mexico Earthquake

A man removes debris from a collapsed building felled by a massive earthquake, in Juchitan, Oaxaca state, Mexico on Friday, hours after one of the most powerful earthquakes ever to strike Mexico hit off its southern Pacific coast. (Luis Alberto Cruz/Associated Press)

The new quake matched the force of a magnitude 8.1 quake that hit the country on June 3, 1932, roughly 500 kilometres west of Mexico City.

A study by Mexico's National Seismological Service said that quake is believed to have killed about 400 people, causing severe damage around the port of Manzanillo. A powerful aftershock that hit 19 days later caused a tsunami that devastated 25 kilometres of coastline, killing 75 people.

With files from CBC News and Reuters