Police, firefighters and ordinary Mexicans, some using only bare hands, found a young girl alive under the rubble of a school that collapsed in a powerful earthquake that flattened buildings and killed at least 245 people.

The discovery raised hope — already dimming — of more survivors trapped beneath pancaked structures after the country's worst 'quake in 32 years.

In one school alone, between 30 to 40 people were believed buried in the rubble, their fate unknown.

At one site in the Roma neighbourhood, rescue workers cheered as they brought out a woman alive from what remained of a toppled building. The workers immediately called for quiet again so they could listen for the sound of survivors under the rubble

Workers pulled 52 people from the rubble of collapsed buildings in the capital.

The city in a tweet pledged: “We won’t stop.”

The magnitude-7.1 earthquake rocked the capital and surrounding area Tuesday, 32 years to the day after a major quake devastated the capital city in 1985.

Luis Felipe Puente, head of the Civil Protection, said the fatalities included 94 from Mexico City, 71 from Morelos State, 43 in Puebla, 12 in the State of Mexico, four in Guerrero and one in Oaxaca.

The quake hit near the town of Raboso, about 76 miles southeast of Mexico City.

Mexico City Mayor Miguel Ángel Mancera said 39 buildings in the capital were destroyed and another 30 properties seriously damaged.

President Enrique Peña Nieto declared three days of mourning.

A number of the fatalities occurred at two schools, including 25 dead at the Enrique Rebsamen School.

All but four were children, according to the federal education department.

Officials overseeing the rescue operations said as many as 40 people were believed to remain trapped in the school, which collapsed with kindergarteners caught on the ground floor.

A possible bright spot emerged when rescuers searching desperately for signs of life amid the debris spotted a young girl buried in the rubble, and shouted at her to move her hand if she could hear them. There was relief when she did so.

A search dog sent into the mass of wood and rock confirmed she was alive.

Authorities asked the public to bring lamps and mirrors to help in the search for more possible survivors.

Teams on the scene in southern Mexico City have used whatever means available — including bare hands — to claw through the rubble all night.

With barely room to move, in an intensely claustrophobic situation, Pedro Serrano, 29, a doctor, managed to make it into a collapsed classroom only to find all occupants dead.

“We dug holes, then crawled in on our bellies,” Serrano told the Associated Press.

“We managed to get into a collapsed classroom. We saw some chairs and wooden tables.

"The next thing we saw was a leg, and then we started to move rubble and we found a girl and two adults — a woman and a man.”

The private Tecnológico de Monterrey university campus in Mexico City, was the scene of five deaths and 40 injuries.

Schools were closed in the city yesterday, but some of the capital's massive subway system and network of buses were operating.

The Mexico City government opened 14 shelters for those whose homes were damaged.

As the quake hit on Tuesday, residents spilled out of buildings. Many stayed huddled in the streets until authorities inspected their buildings. Sirens blared throughout the afternoon. Federal police brought in sniffer dogs to find victims.

Many in the streets said the force of the quake was as strong as the 1985 earthquake, which killed an estimated 9,500 people, destroyed about 100,000 homes and reduced parts of the city to rubble.

That quake, a stronger magnitude-8.1, was only one of several over the past few decades to hit Mexico, one of the most seismically active regions in the world.

“There was this explosion,” said Ubaldo Juárez, a barber, who was riding his bike through the trendy, but hard-hit Condesa neighborhood. “I saw this cloud of dust, like something out of a movie.”

“Normally you have a warning. But this just struck,” said Juárez, who got down on his hands and knees to brace himself.

The earthquake came ironically on the same day when Mexican civil protection officials conduct earthquake drills — and office workers, students and apartment dwellers practice abandoning their buildings. A drill occurred barely two hours before the Tuesday quake hit.

Peña Nieto tweeted he was on a flight to Oaxaca when the quake struck, but he returned immediately to Mexico City, where the international airport suspended operations as personnel checked structures for damage.

Araceli Torres was working at a shopping centre. Having lived through the 1985 earthquake, Torres instantly recalled the terrifying feeling she experienced 32 years ago.

"Suddenly everything started shaking," Torres, 54, said. "I think that those who lived through the earthquake back in 85 experienced a psychosis because it started out really hard. ... I felt as if my heart was going to jump out of my chest."

Torres said despite the 1985 'quake causing substantially more damage and destruction, Ms Torres said the solidarity between people was exactly the same.

Though the 1985 earthquake was substantially more destructive and damaging, Torres said she can still see the same kind of solidarity among people: Neighbors or simply people on the street helping others stay calm.

Residents in the Col. Condesa neighborhood and across the city came armed with buckets to help with rescue efforts — many were still wearing their work clothes and arrived straight from the office.

"The boss sent everyone home. I came to help," said Gonzalo Hernandez, a lawyer still wearing a white dress shirt. "Everyone is asking, 'How can I help out?'"

Volunteers formed long rows to pass buckets full of rubble from a collapsed building. Others brought sandwiches and oranges to feed the volunteers. Urgent calls went out for portable lights to allow rescuers to work and doctors to attend to the injured. Power was restored in some parts of the city, but the most impacted areas were still in the dark.