MEXICO CITY — A powerful 7.1-magnitude earthquake struck central Mexico on Tuesday, collapsing buildings and killing dozens of people on the anniversary of a 1985 quake that devastated Mexico City.

Coming less than two weeks after a deadly temblor off Mexico’s Pacific coast, and just hours after a siren signaled an annual earthquake drill in the capital, Tuesday’s quake shook the ground with terrifying force, buckling walls and sending panicked residents fleeing into the streets. There were reports of fires and gas leaks.

At least 107 people were reported killed, local officials and news agencies and local media reported. They included at least 42 people in Morelos state south of Mexico City, 26 in the central state of Puebla, nine in the state of Mexico — which surrounds the capital — and 30 in Mexico City.

Residents feared more people were buried under rubble. At least 29 buildings crumbled in the massive capital, officials said. In the central Mexico City neighborhood of Del Valle, a frantic scene played out Tuesday afternoon as hundreds of people gathered to search for trapped residents. At least two multi-story apartment buildings tumbled down and residents said dozens of people could have been inside at the time. Marines, medical volunteers and regular citizens formed lines to pass in trash cans, plastic crates, and plastic barrels, to fill with debris.

Rescue workers carried at least one person out on a stretcher while helicopters circled overhead.

Victor Arrecha, 25, who lived nearby, said he feared that up to 40 people might have been trapped inside one of the buildings.

“My friends lived there,” he said, looking at the pancaked apartment building directly in front of his house.

The U.S. Geological Survey said the epicenter of the quake was 76 miles southeast of the capital, near the town of Raboso in Puebla. It struck at 1:14 p.m. local time, the agency said. There appeared to be widespread damage, including to a major highway connecting Mexico City to Cuernavaca, the capital of Morelos located about 35 miles to the south. The Mexico City airport was closed as authorities looked for damage.

At the Clínica Gabriel Mancera in Mexico City, more than a dozen hospital beds had been set up in the patio outside as a triage center. Leticia Gonzalez, a 45-year-old maid in a nearby apartment building, said she tried to race out of the building but that concrete crashed down as she fled. Her right leg was wrapped in a bandage as she grimaced in pain outside the hospital.

“We were all running like crazy,” she said. “This was the worst earthquake I’ve ever seen.”

Marisela Avila Gomez, 58, was in her apartment in the central Narvarte neighborhood in the capital when the shaking began, toppling her furniture and shattering the windows. A piece of glass sliced deep into her right leg.

“I lost about three liters of blood,” she said. “My whole house is full of blood.”

Her husband, Francisco Vicente Lozada Garcia, a 55-year-old landscaper, tried to drive across town to get to his wife, but traffic was snarled and the “street felt like gelatin.”

The couple eventually made it to the Clinica Gabriel Mancera, where Avila Gomez was treated.

The earthquake struck less than two weeks after the 8.1-magnitude quake off the Pacific coast of southern Mexico. Scientists said the same large-scale tectonic mechanism led to both events: the larger North American Plate is forcing the edge of the Cocos Plate to sink. This collision generated both quakes. But it was unlikely the quake earlier this month caused Tuesday’s disaster.

“In general, we don’t think there’s a triggering effect over that kind of a distance,” said Don Blakeman, a geophysicist with the U.S. Geological Survey. In California, he said, there have been earthquakes that set off quakes a few tens of miles away and within hours of each other. This distance was farther and the timeline longer. The recent Mexico quakes did not share a fault line, he said.

Mexico City is partially built on old lake sediment, which is much softer than rock. The seismic waves can be amplified traveling through the sediment, Blakeman said, making the damage worse than in areas on more solid ground. He said aftershocks were possible, too. The rupture was approximately 50 kilometers, or 31 miles deep, and as a rule the shallower an earthquake is the higher the chance for aftershocks. “Fifty kilometers is pretty shallow so I would expect aftershocks,” Blakeman said.

In the southern Mexico City neighborhood of Coyoacan, the walls of colonial-era buildings cracked and sagged when the quake struck, with some collapsing into rubble. Residents embraced and cried in the streets. At the Barricas Don Tiburcio shop, shelves bearing food crashed down and wine bottles shattered on the floors.

“This is the worst one I have ever felt,” shopkeeper Beatriz Aguilar Bustamante said.

President Enrique Peña Nieto was traveling to Oaxaca to inspect the earthquake damage that occurred earlier this month when the latest temblor struck. He turned around and came back to the capital, where he convened a national emergency council.

In a Twitter message Tuesday after receiving news of the quake, President Trump wrote: “God bless the people of Mexico City. We are with you and will be there for you.”