Still, the resounding feeling in the country was one at least initially of relief that the damage was not more widespread, given the nationâs vulnerability to earthquakes and the capitalâs extreme density.
âWe are assessing the damage, which will probably take hours, if not days,â said President Enrique PeÃ±a Nieto, who addressed the nation just two hours after the quake. âBut the population is safe over all. There should not be a major sense of panic.â
While Mexico is no stranger to earthquakes, situated as it is near several boundaries where portions of the earthâs crust collide, Thursdayâs earthquake was more powerful than even the 1985 one that killed nearly 10,000 people.
But while the quake on Thursday struck nearly 450 miles from the capital, off the coast of Chiapas State, the one in 1985 was much closer to the city â so the shaking, coupled with Mexico City being situated on an ancient lake bed, proved much more deadly back then.
After the 1985 disaster, construction codes were reviewed and stiffened. Today, Mexicoâs construction laws are as strict as those in the United States or Japan.
After the quake hit, people in Mexico City streamed out of their homes just before midnight wearing nightclothes, standing amid the apartment buildings, cafes and bars in upscale neighborhoods and the dense warrens of the cityâs working-class communities. In the neighborhood of Condesa, neighbors watched in awe as power lines swayed alongside trees and buildings. In several neighborhoods, the power was out, though it was restored within an hour, at least in the wealthier areas of the city.
For a city used to earthquakes, Thursdayâs quake left a lasting impression on residents, for both its force and duration.
âThe scariest part of it all is that if you are an adult, and youâve lived in this city your adult life, you remember 1985 very vividly,â said Alberto BriseÃ±o, a 58-year-old bar manager in Condesa. âThis felt as strong and as bad, but from what I see, weâve been spared from major tragedy.â
âNow we will do what us Mexicans do so well: Take the bitter taste of this night and move on,â he added.
Thursdayâs earthquake occurred near the Middle America Trench, a zone in the eastern Pacific where one slab of the earthâs crust, called the Cocos Plate, is sliding under another, the North American, in a process called subduction.
The movement is very slow â about three inches a year â and over time stresses build because of friction between the slabs. At some point the strain becomes so great that the rock breaks and slips along a fault. This releases vast amounts of energy and, if the slip occurs under the ocean, can move a lot of water suddenly, causing a tsunami.
Subduction zones ring the Pacific Ocean and are found in other regions as well. They are responsible for the worldâs largest earthquakes and most devastating tsunamis. The magnitude 9 earthquake off Japan in 2011 that led to the Fukushima nuclear disaster and the magnitude 9.1 quake in Indonesia in 2004 that spawned tsunamis that killed a quarter of a million people around the Indian Ocean are recent examples.
Those quakes each released about 30 times as much energy as the one in Mexico.
Mexicoâs government issued a tsunami warning off the coast of Oaxaca and Chiapas after Thursdayâs quake, but neither state appeared to have been adversely affected by waves in the aftermath. The Pacific Tsunami Warning Center said the largest wave recorded on Mexicoâs Pacific Coast measured less than four feet.
In his address, Mr. PeÃ±a Nieto said that aftershocks were of greater concern than the waves generated by the earthquake, which he said was the strongest to hit the country in a century.
Rudy Gomez, 28, who lives in the Condesa neighborhood of Mexico City, said that he spoke to relatives in Chiapas by phone after the quake and that they were all fine. They were worried, however, about the aftershocks.
âAfter the earthquake, there were three more,â he said of the aftershocks in Chiapas. âThey are just waiting to see if there is another one to come, but right now they are O.K.â
In the state of Oaxaca, the town of JuchitÃ¡n appeared particularly hard-hit. In a video posted on the Facebook page of a local TV station, Pamela TerÃ¡n, who introduced herself as a city councilor, begged the state and federal authorities for help.
âPlease, we urgently need as much help as you can send,â she said. âWe need hands and manpower to try and dig out the people that we know are buried under the rubble.â
The same TV station, Cortamortaja, reported the collapse of a hospital in JuchitÃ¡n and showed images of doctors and nurses treating patients in the backyard.
In Guatemala, which shares Mexicoâs southern border, the military was out early Friday morning assessing the damage.
The earthquake struck mainly in the west of the country. In the state capital of Huehuetenango, bricks and glass were strewn on the ground as walls collapsed. Quetzaltenango, Guatemalaâs second-largest city, which was beginning to recover from a tremor in June, suffered more damage to its historic center.