Updated

One of the most powerful earthquakes to ever hit Mexico killed at least 32 people late Thursday night and crippled hundreds of buildings.

The quake hit Mexico’s Pacific coast with a magnitude of 8.1, according to the U.S. Geological Survey – hitting the southern states of Chiapas and Oaxaca hardest. About 50 million people across Mexico felt the earthquake.

Houses toppled, hundreds of buildings either collapsed or were damaged and the power was cut to more than 1.8 million people as a result of the quake.

The city of Juchitán in Oaxaca was hit hard by the earthquake. Images shared on social media showed Juchitán’s large white City Hall building – called Palacio Municipal in Spanish – in rubble.

Twitter user Gregory Jaimes shared a video of a man collecting a Mexican flag from the rubble and putting it on top of the collapsed city hall.

More than 260 aftershocks occurred after the initial quake, Mexico President Enrique Peña Nieto said Friday.

The earthquake hit Mexico as it prepares for the Category 2 Hurricane Katia to slam into its Gulf Coast border around Saturday morning.

Thursday’s earthquake is initially thought to be slightly stronger than the 1985 earthquake that left thousands of people dead in Mexico City.

The Associated Press contributed to this report.