Updated at 8:25 p.m.: Revised throughout with additional details.

One of the most powerful earthquakes ever recorded in Mexico struck off the country's southern coast, toppling hundreds of buildings and sending panicked people fleeing into the streets in the middle of the night.

At least 61people were reported dead.

The quake that hit minutes before midnight Thursday was strong enough to cause buildings to sway violently in the capital city more than 650 miles away. As beds banged against walls, people still wearing pajamas ran out of their homes and gathered in frightened groups.

{"type":"video","title":"Dallas News Video","author_name":"Dallas News","_id":"liOGNsYzE6IXpJaEv3PowsbWS_0n_n9-","provider_name":"Ooyala","html":"

","raw":"{\"type\":\"video\",\"title\":\"Dallas News Video\",\"author_name\":\"Dallas News\",\"_id\":\"liOGNsYzE6IXpJaEv3PowsbWS_0n_n9-\",\"provider_name\":\"Ooyala\",\"html\":\"\\u003Cdiv class=\\\"oo-vid-container\\\" data-oo-content-id=\\\"liOGNsYzE6IXpJaEv3PowsbWS_0n_n9-\\\"\\u003E\\u003C\\/div\\u003E\\u003Cscript defer src=\\\"https:\\/\\/www.dallasnews.com\\/resources\\/motif\\/dist\\/js\\/ooyala.js\\\"\\u003E\\u003C\\/script\\u003E\"}","providerType":"ooyala","providerLink":"https://www.dallasnews.com/oembed","embedType":"video"}

Rodrigo Soberanes, who lives near San Cristobal de las Casas in Chiapas, the state nearest the epicenter, said his house "moved like chewing gum."

The furious shaking created a second national emergency for Mexican agencies already bracing for Hurricane Katia on the other side of the country. The system was expected to strike the Gulf Coast in the state of Veracruz early Saturday as a Category 2 storm that could bring life-threatening floods.

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

Bowling alley in Tuxtla Gutierrez feels force of Mexico's earthquakehttps://t.co/k0msijw1Yp pic.twitter.com/25FWrwe8y6 — BBC News (World) (@BBCWorld) September 8, 2017

The worst-hit city was Juchitan, on the narrow waist of Oaxaca known as the Isthmus, where 36 quake victims died.

About half of Juchitan's city hall collapsed in a pile of rubble and streets were littered with the debris of ruined houses. A hospital also collapsed, Peña Nieto said after touring the city and meeting with residents. The patients were relocated to other facilities.

The president said authorities were working to re-establish the supply of water and food and provide medical attention to those who need it. He vowed the government would help people rebuild and called for people to come together.

"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," Peña Nieto said.

1 / 12A boy takes pictures of a knocked-down building at the eastern area of Mexico City after a powerful earthquake hit. (Alfredo Estrella / Agence France-Presse) 2 / 12View of a street at the eastern area of Mexico City after a 8,2 earthquake on September 8, 2017. A powerful 8.2-magnitude earthquake rocked Mexico late Thursday, killing at least 16 people in what the president called the quake-prone country's biggest one in a century. / AFP PHOTO / ALFREDO ESTRELLAALFREDO ESTRELLA/AFP/Getty Images(ALFREDO ESTRELLA / Getty Images) 3 / 12View of a street at the eastern area of Mexico City after a 8,2 earthquake on September 8, 2017. A powerful 8.2-magnitude earthquake rocked Mexico late Thursday, killing at least 16 people in what the president called the quake-prone country's biggest one in a century. / AFP PHOTO / ALFREDO ESTRELLAALFREDO ESTRELLA/AFP/Getty Images(ALFREDO ESTRELLA / Getty Images) 4 / 12View of a street at the eastern area of Mexico City after a 8,2 earthquake on September 8, 2017. A powerful 8.2-magnitude earthquake rocked Mexico late Thursday, killing at least 16 people in what the president called the quake-prone country's biggest one in a century. / AFP PHOTO / ALFREDO ESTRELLAALFREDO ESTRELLA/AFP/Getty Images(ALFREDO ESTRELLA / Getty Images) 5 / 12View of a street at the eastern area of Mexico City after a 8,2 earthquake on September 8, 2017. A powerful 8.2-magnitude earthquake rocked Mexico late Thursday, killing at least 16 people in what the president called the quake-prone country's biggest one in a century. / AFP PHOTO / ALFREDO ESTRELLAALFREDO ESTRELLA/AFP/Getty Images(ALFREDO ESTRELLA / Getty Images) 6 / 12View of a street at the eastern area of Mexico City after a 8,2 earthquake on September 8, 2017. A powerful 8.2-magnitude earthquake rocked Mexico late Thursday, killing at least 16 people in what the president called the quake-prone country's biggest one in a century. / AFP PHOTO / ALFREDO ESTRELLAALFREDO ESTRELLA/AFP/Getty Images(ALFREDO ESTRELLA / Getty Images) 7 / 12View of a street at the eastern area of Mexico City after a 8,2 earthquake on September 8, 2017. A powerful 8.2-magnitude earthquake rocked Mexico late Thursday, killing at least 16 people in what the president called the quake-prone country's biggest one in a century. / AFP PHOTO / ALFREDO ESTRELLAALFREDO ESTRELLA/AFP/Getty Images(ALFREDO ESTRELLA / Getty Images) 8 / 12View of a street at the eastern area of Mexico City after a 8,2 earthquake on September 8, 2017. A powerful 8.2-magnitude earthquake rocked Mexico late Thursday, killing at least 16 people in what the president called the quake-prone country's biggest one in a century. / AFP PHOTO / ALFREDO ESTRELLAALFREDO ESTRELLA/AFP/Getty Images(ALFREDO ESTRELLA / Getty Images) 9 / 12A policeman stands in front of a church whose towers were damaged by an 8.1-magnitude earthquake in San Cristobal de Las Casas, state of Chiapas, Mexico, early Friday, Sept. 8, 2017. One of the most powerful earthquakes ever to strike Mexico hit off its southern coast, killing at least 15 people, toppling houses and businesses and sending panicked people into the streets. (AP Photo/Moyses Zuniga)(Moyses Zuniga / AP) 10 / 12TOPSHOT - People gather on a street in downtown Mexico City during an earthquake on September 7, 2017. An earthquake of magnitude 8.0 struck southern Mexico late Thursday and was felt as far away as Mexico City, the US Geological Survey said, issuing a tsunami warning. It hit offshore 120 kilometers (75 miles) southwest of the town of Tres Picos in the state of Chiapas. / AFP PHOTO / PEDRO PARDOPEDRO PARDO/AFP/Getty Images(PEDRO PARDO / Getty Images) 11 / 12A monument surrounded by debris is cordoned off in the aftermath of an 8.1-magnitude earthquake in San Cristobal de Las Casas, state of Chiapas, Mexico, early Friday, Sept. 8, 2017. One of the most powerful earthquakes ever to strike Mexico hit off its southern coast, killing at least 15 people, toppling houses and businesses and sending panicked people into the streets. (AP Photo/Moyses Zuniga)(Moyses Zuniga / AP) 12 / 12A video grab made from AFPTV footage shows damage to a building in Minatitlan, Mexico, on September 8, 2017 after a powerful 8.2-magnitude earthquake rocked Mexico late on September 7. A powerful 8.2-magnitude earthquake rocked Mexico late September 7, killing at least 15 people and triggering a tsunami alert in what the president called the quake-prone country's biggest one in a century. / AFP PHOTO / AFPTV / Carlos SANTOS AND Lizbeth CUELLOCARLOS SANTOS,LIZBETH CUELLO/AFP/Getty Images(CARLOS SANTOS / Getty Images)

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.

Families were jerked awake by the grating howl of the capital's seismic alarm. Some shouted as they dashed out of rocking apartment buildings. Even the iconic Angel of Independence Monument swayed as the quake's waves rolled through the city's soft soil.

Elsewhere, the extent of destruction was still emerging. 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.

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

The earthquake's impact was blunted somewhat by the fact that it was centered 100 miles offshore. It hit off Chiapas' Pacific coast, near the Guatemalan border with a magnitude of 8.1 — equal to Mexico's strongest quake of the past century. It was slightly stronger than the 1985 quake, the U.S. Geological Survey said.

A least 15 people have died after 8.1-magnitude earthquake strikes off coast of southern Mexico, state media reports https://t.co/uvaGJ8M5kb pic.twitter.com/AY2QktAo8e — CNN (@CNN) September 8, 2017

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

The quake struck at 11:49 p.m. Thursday. Its epicenter was about 100 miles west of Tapachula in Chiapas, with a depth of 43.3 miles, the USGS said.

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

Three people were killed in San Cristobal, including two women who died when a house and a wall collapsed, Chiapas Gov. Manuel Velasco said.

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

In Tabasco, one child died when a wall collapsed, and an infant died in a children's hospital when the facility lost electricity, cutting off the ventilator, Gov. Arturo Nunez said.

The quake triggered tsunami warnings and some tall waves, but there was no major damage from the sea. Authorities briefly evacuated a few residents of coastal Tonala and Puerto Madero because of the warning.

The Pacific Tsunami Warning Center reported waves of 3.3 feet above the tide level off Salina Cruz, Mexico. Smaller tsunami waves were observed on the coast or measured by ocean gauges elsewhere.

In neighboring Guatemala, President Jimmy Morales appeared on national television to call for calm while emergency crews surveyed damage. Officials later said only four people had been injured and several dozen homes damaged.

The quake occurred near the point of collision between three tectonic plates, the Cocos, the Caribbean and the North American.

The area has seen at least six other quakes of magnitude 7.0 or greater since 1900. Three of those occurred within a nerve-wracking nine-month span in 1902-1903, according to Mexico's National Seismological Service.

Scientists were still reviewing data, but a preliminary analysis indicated the quake was triggered by the sudden breaking or bending of the Cocos plate, which dives beneath Mexico. That type of process does not happen often in subduction zones. Usually, big quakes in subduction zones occur along the boundary between the sinking slab and the overriding crust.

"It's unusual, but it's not unheard of," said seismologist Susan Hough of the USGS, describing how stresses on the seafloor can produce big earthquakes.

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

A study by the seismological service concluded that that quake killed about 400 people and caused severe damage around the port of Manzanillo. A powerful aftershock that hit 19 days later caused a tsunami that devastated 15 miles of coastline, killing 75 people.

Texas Gov. Greg Abbott pledged Texas assistance, returning the favor to Mexico, which is sending community and mobile kitchens to help the state in the wake of Hurricane Harvey.

"Our hearts go out to the victims of this devastating tragedy and their families," Abbott said in a statement released Friday.

"Just as Mexico stood with Texas in our time of need, Texas will stand with Mexico and offer whatever aid and assistance we can to help them recover after this disaster. I ask all Texans to join Cecilia and me in praying for the victims and the people of Mexico this morning."

Staff Writer Alfredo Corchado contributed to this report.

Posted by Breaking News editor Chris Siron