The death toll has risen to at least 248 in the powerful earthquake that shook central Mexico on Tuesday, collapsing buildings in plumes of dust and prompting thousands to pour onto the streets in panic.
Dozens of buildings tumbled into mounds of rubble or were severely damaged in densely populated parts of Mexico City and nearby states. Mayor Miguel Angel Mancera said buildings fell at 44 places in the capital alone as high-rises across the city swayed sickeningly.
Hours after the magnitude 7.1 quake, rescue workers were still clawing through the wreckage of a primary school that partly collapsed in the city's south, looking for any children who might be trapped. Some relatives said they had received WhatsApp message from two girls inside.
The federal education department reported late on Tuesday night that 25 bodies had been recovered from the school's wreckage, all but four of them children. It was not clear whether those deaths were included in the overall death toll of 248 reported by the federal civil defence agency.
President Enrique Pena Nieto visited the school earlier in the night. At the time, he said 22 bodies had been found, and added in comments broadcast online by Financiero TV that 30 children and eight adults were reported missing. Rescuers were continuing their search and pausing to listen for voices from the rubble.
Later, Mr Pena Nieto issued a video message urging calm and saying the initial focus of authorities is on finding people trapped in fallen buildings.
"The priority at this moment is to keep rescuing people who are still trapped and to give medical attention to the injured people," he said.
The quake is the deadliest in Mexico since a 1985 quake on the same date killed thousands. It came less than two weeks after another powerful quake caused 90 deaths in the country's south.
The civil defence agency reported early on Wednesday that the confirmed death toll stood at 248, more than half of them in the capital.
The official Twitter feed of agency head Luis Felipe Puente said 117 dead had been counted in Mexico City and 72 in Morelos state, which is just south of the capital. It said 43 were known dead in Puebla state, where the quake was centred. Twelve deaths were listed in the state of Mexico, which surrounds Mexico City on three sides, three in Guerrero state and one in Oaxaca.
The federal government declared a state of disaster in Mexico City, freeing up emergency funds. Mr Pena Nieto said he had ordered all hospitals to open their doors to the injured.
The federal interior minister, Miguel Angel Osorio Chong, said authorities had reports of people possibly still being trapped in collapsed buildings. He said search efforts were slow because of the fragility of rubble.
"It has to be done very carefully," he said. And "time is against us."
At one site, reporters saw onlookers cheer as a woman was pulled from the rubble. Rescuers immediately called for silence so they could listen for others who might be trapped.
Mariana Morales, a 26-year-old nutritionist, was one of many who spontaneously participated in rescue efforts.
She wore a paper face mask and her hands were still dusty from having joined a rescue brigade to clear rubble from a building that fell in a cloud of dust before her eyes, about 15 minutes after the quake.
Ms Morales said she was in a taxi when the quake struck, and she got out and sat on a sidewalk to try to recover from the scare. Then, just a few yards away, the three-story building fell.
A dust-covered Carlos Mendoza, 30, said that he and other volunteers had been able to pull two people alive from the ruins of a collapsed apartment building after three hours of effort.
"We saw this and came to help," he said. "It's ugly, very ugly."
Alma Gonzalez was in her fourth floor apartment in the Roma neighbourhood when the quake pancaked the ground floor of her building, leaving her no way out — until neighbours set up a ladder on their roof and helped her slide out of a side window.
Gala Dluzhynska was taking a class with 11 other women on the second floor of a building on trendy Alvaro Obregon street when the quake struck and window and ceiling panels fell as the building began to tear apart.
She said she fell in the stairs and people began to walk over her, before someone finally pulled her up.
"There were no stairs anymore. There were rocks," she said.
They reached the bottom only to find it barred. A security guard finally came and unlocked it.
The quake sent people throughout the city fleeing from homes and offices, and many people remained in the streets for hours, fearful of returning to the structures.
Alarms blared and traffic stopped around the Angel of Independence monument on the iconic Reforma Avenue.
Electricity and mobile phone service was interrupted in many areas and traffic was snarled as signal lights went dark.
The US geological survey said the magnitude 7.1 quake hit at 1.14pm and was centred near the Puebla state town of Raboso, about 123 kilometres south-east of Mexico City.
Puebla governor Tony Gali tweeted there were damaged buildings in the city of Cholula, including collapsed church steeples.
In Jojutla, a town in neighbouring Morelos state, the town hall, a church and other buildings tumbled down.
The Instituto Morelos secondary school partly collapsed in Jojutla, but school director Adelina Anzures said the earthquake drill that the school held in the morning was a boon when the real thing hit just two hours later.
"I told them that it was not a game, that we should be prepared," Ms Anzures said of the drill. When the shaking began, children and teachers filed out rapidly and no one was hurt, she said.
"It fell and everything inside was damaged."
Earlier in the day, workplaces across Mexico City had held earthquake readiness drills on the anniversary of the 1985 quake, a magnitude 8.0 shake that killed thousands of people and devastated large parts of the capital.
In that tragedy, too, ordinary citizens played a crucial role in rescue efforts that overwhelmed officials.
Market stall vendor Edith Lopez, 25, said she was in a taxi a few blocks away when the quake struck on Tuesday. She said she saw glass bursting out of the windows of some buildings. She was anxiously trying to locate her children, whom she had left in the care of her disabled mother.
Local media broadcast video of whitecap waves churning the city's normally placid canals of Xochimilco as boats bobbed up and down.
Mexico City's international airport suspended operations and was checking facilities for damage.
Much of Mexico City is built on former lake bed, and the soil can amplify the effects of earthquakes centred hundreds of miles away.
The new quake appeared to be unrelated to the magnitude 8.1 temblor that hit on September 7 off Mexico's southern coast and also was felt strongly in the capital.
US geological survey seismologist Paul Earle noted the epicentres of the two quakes were 650 kilometres apart and said most aftershocks are within 100 kilometres.
There have been 19 earthquakes of magnitude 6.5 or larger within 250 kilometres of Tuesday's quake over the past century, Mr Earle said.
Earth usually has about 15 to 20 earthquakes this size or larger each year, he added.
Initial calculations showed that more than 30 million people would have felt moderate shaking from Tuesday's quake.