NEW YORK — A gas leak triggered an earthshaking explosion that flattened two apartment buildings on Wednesday, killing at least three people, injuring more than 60 and leaving nine missing. A tenant said residents had complained repeatedly in recent weeks about “unbearable” gas smells.

By evening, rescue workers finally began the search for victims amid the broken bricks, splintered wood and mangled metal after firefighters spent most of the day dousing the flames. Heavy equipment, including back hoes and a bulldozer, arrived to clear the mountain of debris where the two five-story East Harlem buildings stood. Flood lights were in place. Thermal imaging cameras were at the ready to identify heat spots — bodies or pockets of fire.

The recovery was facing hardship in the form of the weather, which was expected to drop into the 20s with rain. Some parts of the debris pile were inaccessible because of a sinkhole caused by a subsurface water main break, officials said.

The fiery blast, on Park Avenue at 116th Street, not far from the edge of Central Park, erupted about 9:30 a.m., around 15 minutes after a neighboring resident reported smelling gas, authorities said. The Con Edison utility said it immediately sent workers to check out the report, but they didn’t arrive until it was too late.

The explosion shattered windows a block away, rained debris onto elevated commuter railroad tracks close by, cast a plume of smoke over the skyline and sent people running into the streets.

“It felt like an earthquake had rattled my whole building,” said Waldemar Infante, a porter who was working in a basement nearby. “There were glass shards everywhere on the ground, and all the stores had their windows blown out.”

Police said two women believed to be in their 40s were killed. At least three of the injured were children; one, a 15-year-old boy, was reported in critical condition with burns, broken bones and internal injuries. Most of the other victims’ injuries were minor and included cuts and scrapes.

Fire officials said some people were unaccounted for but cautioned they may not have been in the buildings.

A tenant in one of the destroyed buildings, Ruben Borrero, said residents had complained to the landlord about smelling gas as recently as Tuesday.

A few weeks ago, Borrero said, city fire officials were called about the odor, which he said was so bad that a tenant on the top floor broke open the door to the roof for ventilation.

“It was unbearable,” said Borrero, who lived in a second-floor apartment with his mother and sister, who were away at the time of the explosion. “You walk in the front door and you want to turn around and walk directly out.”

Page 2 of 3 - The fire department said a check of its records found no instances in the past month in which tenants of the two buildings reported gas odors or leaks.

Jennifer Salas lived in one of the buildings. She told The New York Times her husband, Jordy Salas, and her dog were in the building at the time of the collapse and were missing.

“There’s six floors in the building; each floor has one apartment,” she said. “Last night it smelled like gas, but then the smell vanished and we all went to sleep.”

Edward Foppiano, a Con Ed senior vice president, said there was only one gas odor complaint on record with the utility from either address, and it was last May, at the building next door to Borrero’s. It was a small leak in customer piping and was fixed, he said.

The block was last checked on Feb. 28 as part of a regular leak survey, and no problems were detected, Foppiano said.

One of the side-by-side buildings had a piano store on the first floor, the other a storefront church.

City records show that the building Borrero lived in was owned by Kaoru Muramatsu, proprietor of the piano business. A phone number listed for Muramatsu rang unanswered.

Records at the Department of Housing Preservation and Development indicate the agency responded to complaints from a tenant and cited Muramatsu in January for a broken outlet, broken plaster, bars over a fire escape, a missing window guard and missing carbon monoxide and smoke detectors.

City building records don’t show any work in progress at either address, but the building owned by the Spanish Christian Church had obtained permits and installed 120 feet of gas pipe last June.

Con Ed said it remains to be seen whether the leak was in a company main or in customer-installed inside plumbing. The gas main that serves the area was made of plastic and cast iron, and the iron dated to 1887, Foppiano said.

“Age is not in and of itself an issue with cast iron,” he said, noting that Con Edison has a cast iron replacement program and the pipe was not slated to be removed in the next three-year period.

A National Transportation Safety Board team arrived in the evening to investigate. The agency investigates pipeline accidents in addition to transportation disasters.

Just before the explosion, a resident from a building next to the two that were destroyed reported smelling gas inside his apartment and thought the odor might be coming from outside, Con Ed spokesman Bob McGee said. Con Ed dispatched two crews two minutes after the 9:15 a.m. call came in, McGee said. But they didn’t get there in time.

Page 3 of 3 - The tragedy brought the neighborhood to a standstill as police set up barricades to keep residents away. Thick, acrid smoke made people’s eyes water. Some people wore surgical masks, while others held their hands or scarves over their faces. Witnesses said the blast was so powerful it knocked groceries off store shelves.

The Metro-North Railroad, which serves 280,000 riders a day in New York and Connecticut, suspended service to and from Grand Central Terminal, one of the nation’s busiest commuter hubs, for much of the day while the debris was removed from its tracks, the structural integrity of the elevated structure was checked and test trains were run past the explosion site to see if vibrations would endanger the rescue effort. Service resumed late in the afternoon.

A resident of one of the buildings, Eusebio Perez, heard news of the explosion and hurried back from his job as a piano technician.

“There’s nothing left,” he said. “Just a bunch of bricks and wood.”

He added: “I only have what I’m wearing. I have to find a place to stay for tonight and organize what’s going to be my next steps.”

A Red Cross center was set up at a public school, where about 50 people had gathered, including some who were searching for loved ones.

The explosion destroyed everything Borrero’s family owned, including the ashes of his father, who died a few years ago. Borrero said he assumes his 5-year-old terrier, Nina, was killed.