By CHRISTOPHER SHERMAN and E. EDUARDO CASTILLO, Associated Press

MEXICO CITY (AP) — A major earthquake off Mexico’s southern coast killed at least five people, with the president saying Friday it was the biggest in a century to hit the country. Houses and at least one hotel toppled, electricity was cut and people fled into the streets in panic.

The U.S. Geological Survey reported the earthquake’s magnitude as 8.1, but President Enrique Pena Nieto quoted local calculations it was 8.2, making it the largest in Mexico in 100 years — even larger than the magnitude 8.1 quake in 1985, which killed thousands and devastated large sections of Mexico City.

Officials said at least five people died, but the death toll could rise as authorities assess the damage. The government closed schools Friday in at least 11 states to check them for safety.

The U.S. Geological Survey recorded at least 20 aftershocks of magnitude 4.0 or greater within about five hours after the main shake, and the president warned that a major aftershock as large as magnitude 7.2 could occur.

Pena Nieto said that serious damage had been caused and that 1 million customers initially had been without power following the quake, but that electricity had been restored to 800,000 of them.

The USGS said the quake struck at 11:49 p.m. Thursday local time and its epicenter was 165 kilometers (102 miles) west of Tapachula in Chiapas, close to Guatemala. It had a depth of 69.7 kilometers (43.3 miles).

The quake caused buildings to sway violently in Mexico’s capital more than 1,000 kilometers (650 miles) away. Residents fled buildings, many in their pajamas, and gathered in frightened groups in the street. Some neighborhoods remained in darkness after electricity was knocked out.

Guest of an hotel stand and sit at the lobby after an earthquake shook buildings forcefully and knocked out power in the area, just after midnight in Veracruz, Mexico, Friday Sept. 8, 2017. A massive 8-magnitude earthquake hit off the coast of southern Mexico late Thursday night, causing buildings to sway violently and people to flee into the street in panic as far away as the capital city and Veracruz state.(AP Photo/Felix Marquez)

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

Chiapas Gov. Manuel Velasco said that three people were killed in San Cristobal, including two women who died when a house and a wall collapsed. He 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.”

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.

The Pacific Tsunami Warning Center said waves of one meter (3.3 feet) 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 center’s forecast said Ecuador, El Salvador and Guatemala could see waves of a meter or less. No threat was posed to Hawaii and the western and South Pacific.

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

Meanwhile, Mexico was bracing for another natural emergency 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 early Saturday as a Category 2 storm that could bring life-threatening floods.

In neighboring 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.

A general view of Mexico City after an earthquake, in the early morning hours of Friday, Sept. 8, 2017. A massive 8.1-magnitude earthquake hit off Mexico’s southern coast, toppling houses in Chiapas state, causing at least three deaths and setting off a tsunami warning, officials said Friday.(AP Photo/Rebecca Blackwell)

Lucy Jones, a seismologist in California who works with the U.S. Geological Survey, said such a quake was to be expected.

“Off the west coast of Mexico is what’s called the subduction zone, the Pacific Plate is moving under the Mexican peninsula,” she said. “It’s a very flat fault, so it’s a place that has big earthquakes relatively often because of that.”

“There’s likely to be a small tsunami going to the southwest. It’s not going to be coming up and affecting California or Hawaii,” she said. “For tsunami generation, an 8 is relatively small.”

___

Frank Griffiths in London contributed to this report.