Rescue workers look at fellow workers searching for people under the rubble of a collapsed building after an earthquake hit Mexico City, Mexico September 19, 2017. REUTERS/Carlos Jasso

Desperate rescue workers scrabbled through rubble in a floodlit search on Wednesday for dozens of children feared buried under a Mexico City school, one of hundreds of buildings wrecked by the country's most lethal earthquake in a generation.

The magnitude 7.1 shock killed at least 217 people, nearly half of them in the capital, 32 years to the day after a devastating 1985 quake and less than two weeks after a powerful tremor killed nearly 100 people in the south of the country.

Among the twisted concrete and steel ruin of the Enrique Rebsamen school, soldiers and firefighters found at least 22 dead children and two adults, while another 30 children and 12 adults were missing, President Enrique Pena Nieto said.

There were chaotic scenes at the school as bulldozers moved rubble under the buzz and glare of floodlights powered by generators, and parents at the school clung to hope their children had survived.

"They keep pulling kids out, but we know nothing of my daughter," said 32-year-old Adriana D'Fargo, her eyes red after hours waiting for news of her seven-year-old.

Three survivors were found at around midnight as volunteer rescue teams formed after the 1985 quake and known as "moles" crawled deep under the rubble.

TV network Televisa reported that 15 more bodies, mostly children, had been recovered, while 11 children were rescued.

The earthquake toppled dozens of buildings, broke gas mains and sparked fires across the city and other towns in central Mexico. Falling rubble and billboards crushed cars.

In a live broadcast, one newsreader had time to say "this is not a drill", before weaving his way out of the buckling studio.

Parts of colonial-era churches crumbled in the state of Puebla, where the U.S. Geological Survey (USGS) located the quake's epicenter, some 100 miles (158 km) southwest of the capital, at a depth of 51 km (32 miles)

As the earth shook, Mexico's Popocatepetl volcano, visible from the capital on a clear day, had a small eruption. On its slopes, a church in Atzitzihuacan collapsed during mass, killing 15 people, Puebla Governor Jose Antonio Gali said.

U.S. President Donald Trump mentioned the earthquake in a tweet, saying: "God bless the people of Mexico City. We are with you and will be there for you."

Residents of Mexico City, a metropolitan region of some 20 million people, slept in the streets while authorities and volunteers set up tented collection centers to distribute food and water.

Volunteers, soldiers and firefighters formed human chains and dug with hammers and picks to find dust-covered survivors and dead bodies in the remains of apartment buildings, schools and a factory.

The middle-class neighborhood of Del Valle was hit hard, with several buildings toppling over on just one street. Reserve rescue workers arrived late at night and were still pulling survivors out in the small hours of Wednesday.

With power out in much of the city, the work was carried out in the dark or with flashlights and generators. Rescue workers requested silence as they listened for signs of life.

Some soldiers were armed with automatic weapons. Authorities said schools would be shut on Wednesday as damage was assessed.

Emergency personnel and equipment were being deployed across affected areas so that "throughout the night we can continue aiding the population and eventually find people beneath the rubble," Peña Nieto said in a video posted on Facebook earlier on Tuesday evening.

In Obrera, central Mexico City, people applauded when rescuers managed to retrieve four people alive, with cheers of "si se puede" -- "yes we can" -- ringing out.

Volunteers continued arriving throughout the night, following calls from the civil protection agency, the Red Cross and firefighters.

The quake had killed 86 people in the capital by early Wednesday morning, according to Civil Protection chief Luis Felipe Puente -- fewer than he had previously estimated. In Morelos State, just to the south, 71 people were killed, with hundreds of homes destroyed. In Puebla at least 43 died.

Another 17 people were reported killed in the states of Mexico, Guerrero and Oaxaca.

As many as 4.6 million homes, businesses and other facilities had lost electricity, according to national power company Comisión Federal de Electricidad, including 40 percent of homes in Mexico City.

Moises Amador Mejia, a 44-year-old employee of the civil protection agency, was working late into the night to rescue people trapped in a collapsed building in Mexico City's bohemian Condesa neighborhood.

"The idea is to stay here until we find who is inside. Day and night."