Scenes from the New York building collapse as seen via videos shared on social media outlets. (The Washington Post)

An explosion following a gas leak tore through two apartment buildings in Manhattan on Wednesday morning, leveling the buildings, killing at least seven people and injuring dozens of others.

The explosion and collapse of the two buildings in East Harlem — at 1644 and 1646 Park Avenue, just blocks from Central Park — blew out windows in cars and buildings in the area, spewed smoke into the air, reverberated for blocks and scattered debris on the surrounding streets, sidewalks and elevated train tracks.

New York Mayor Bill de Blasio said the explosion appeared to stem from a gas leak.

“This is a tragedy of the worst kind, because there was no indication in time to save people,” he said at a news conference.

Authorities said it appeared that the only warning came not long before the explosion. Con Edison said that it received a call at 9:13 a.m. about a gas odor in the area. Two crews were dispatched minutes later, but they arrived after the explosion, which occurred about 9:30 a.m.

Two people first reported killed were female, according to the New York City Police Department. A third death was later confirmed by the New York Fire Department. Four additional deaths were confirmed Thursday.

Dozens of injured people scattered to hospitals across the area. At least 50 people were injured, the Associated Press reported. Two dozen people were taken to Mount Sinai and Mount Sinai St. Luke’s. Two people were critically injured, while five had serious but not life-threatening injuries. the Fire Department said.

A fire department official cautioned that the injury number could change, noting that some people may only seek medical treatment later or take themselves to a hospital.

The two collapsed buildings had a total of 15 residential units, authorities said.

Hundreds of emergency responders headed to the scene to put out the fire, clear debris, search for victims and transport people who needed medical attention.

“It’s going to be a long, extended operation to make sure that we can get through that debris as quickly as possible,” said Salvatore J. Cassano, the fire commissioner.

The initial call about gas came from someone in a nearby building, authorities said.

Con Edison said in a statement that it would “conduct a thorough investigation” to figure out what caused the explosion. The utility shut down electric and gas service in the vicinity while crews worked to make the area safe, it said.

Erika Colon came up to East Harlem on Wednesday to help her mother, who lives in a building for seniors a block and a half away from the explosion.

“This is awful and ridiculous,” said Colon, 35, who lives downtown. “My mom said she was smelling gas out her window since Monday.”

In the hours after the explosion, the scene was chaotic. People wore masks to protect against the smoke-filled air.

The block between Madison and Park avenues was choked with barriers, police, firetrucks, American Red Cross workers and city employees, stranding some who live in the heavily residential neighborhood.

“I want to go home!” said Carmen Ortiz, 35, a home health aide who works downtown. Her apartment was on the closed block. “I’ve been working for six hours, and they won’t let me in my apartment.”

Ortiz left for work early, so she missed the explosions that occurred just east of her building. She returned at 3:30 p.m. but couldn’t get home. “I don’t want to stay at a shelter tonight,” she said.

The Red Cross established a disaster relief center at a nearby elementary school, offering shelter and aid to people affected by the collapse.

President Obama was briefed on the incident, the White House said. A team from the National Transportation Safety Board was dispatched to investigate the explosion.

The Metropolitan Transportation Authority suspended Metro-North rail service in and out of Grand Central Terminal for several hours. Debris from the explosions had landed on Metro-North’s elevated tracks, which run over Park Avenue.

Crews worked to clear debris from the tracks while, just over their shoulders, firefighters worked to put out the fire eating at the remains of the buildings. Metro-North service was restored just before 5 p.m.

People reported hearing or feeling the explosion at least several blocks away. Closer to it, Maurice Watson said he heard “a big, loud boom” from his nearby home on the top floor of a five-story apartment building.

“The floor shook,” said Watson, 30, who had Wednesday off from work. “I braced myself and slid to the windows. I saw a mini-9/11 cloud of smoke, and debris was flying all through it.”

Watson went outside to have a look and then around the corner for coffee and cigarettes. When he got outside, police told him he couldn’t go back into his home.

“But it’s all right. I have family nearby I can stay with,” he said. “The buildings are gone. And tomorrow’s gonna come.”

Anders reported from New York.