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 toppled and the quake produced tsunami waves and sent people running into the streets in panic.

The U.S. Geological Survey reported the earthquake’s magnitude as 8.1, but President Enrique Pena Nieto says it was 8.2, making it the largest in Mexico in 100 years. He also said it was bigger than the one in 1985, when thousands were killed in four Mexican states.

“It was a large-scale earthquake,” Pena Nieto said. “It had a bigger magnitude than the one Mexicans knew in 1985.”

He said that 62 aftershocks followed the quake and it’s possible one as strong as 7.2 could hit in the next 24 hours. Pena Nieto also 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, not far from Guatemala. It had a depth of 69.7 kilometers (43.31 miles).

The quake was so strong that it 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.

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.

Tabasco Gov. Arturo Nunez said two children had died in his 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 says 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.