A subway overpass collapsed in Mexico City on Monday night, sending the cars of a passenger train crashing to the ground and killing at least 23 people, including children, according to the city’s mayor. At least 70 others were injured and were taken to hospitals.

The accident happened at 10:22 p.m. on Line 12, one of the city’s newest stretches of track, which opened in 2012. After a powerful earthquake devastated parts of the city in September 2017, local residents expressed concern about the structural integrity of the overpass, including cracks in the concrete.

Local officials did not address specific concerns in the immediate aftermath of Monday’s accident, but Mayor Claudia Sheinbaum stated that the train line was maintained on a daily basis. In recent years, the system as a whole has been plagued by issues. “At this moment, we can’t speculate about what happened,” Ms. Sheinbaum told reporters early Tuesday. “There has to be a deep investigation, and whoever is responsible has to be held responsible.”

According to government officials, the search for survivors had largely turned into a recovery operation by Tuesday morning, with four of the victims’ bodies still trapped in the wreckage. “It is sad news,” said President Andrés Manuel López Obrador of Mexico. “We send our condolences to the families of the victims of this accident.”

The government released photos and videos of the crash, which showed at least one orange-and-yellow subway car hanging from an overpass. An eight-second video of the collapse captured automobile traffic on both sides of the suspended bridge. It suddenly cracks and buckles, erupting in a burst of concrete and sparks between the lanes of traffic.

Following the collapse, a crane held one car in the air while emergency personnel checked to see if any passengers remained trapped. Carlos Ziga Pérez, a Mexican television host, tweeted a video of emergency medical personnel rescuing injured passengers from a tilted subway car by assisting them down ladders.

While a helicopter hovered overhead, ambulances, firefighters, the military, and Mexico’s forensic department arrived and left the scene. The Mexico City Metro, officially known as the Sistema de Transporte Colectivo, has issued a warning to residents to avoid the area. Ms. Sheinbaum stated that she was on the scene assisting rescue personnel and that minors were among the deceased. At least 70 people were injured and were taken to hospitals.

Enrique Bonilla, 57, a train passenger, told reporters that people had collapsed on top of each other and that he was able to grab a pole and escape through a broken window. It was all over in seconds, Mr. Bonilla added. “Thank God I came out alive.”

Mexico City, the country’s sprawling capital, has a subway system that handles over four million passengers per day. After the one in New York City, it is the second-largest in the Americas. When it first opened in 1969, the system was Mexico’s pride, but in recent years it has become a symbol of urban decay.

Following a powerful earthquake in Mexico in September 2017, there was concern about the integrity of the elevated tracks and support columns on the stretch of tracks where the accident occurred on Monday. The quake damaged the elevated infrastructure on the subway line, known as Line 12, or the Golden Line.

Some locals later expressed concern that the damaged infrastructure would collapse. At the time, the newspaper reported that a column between the Olivos and Nopalera stations had suffered structural damage.