A construction worker was seriously injured Tuesday afternoon after part of a vacant building collapsed, according to city officials, trapping him under a heap of rubble for more than an hour.

"The debris that they encountered was up to his waist," FDNY Division Chief Stacy Scanlon said. "We were able to gain access to the patient…and also watching his vital signs."

It happened around 12:38 p.m. Tuesday at a building on Rutland Road near Brooklyn Ave. in East Flatbush. The city buildings department said the man was apparently scavenging for materials when the first floor collapsed, partially burying him in debris.

More than a hundred city firefighters and paramedics spent an hour-and-a-half digging the man out, working carefully to reduce the risk other portions of the building would also give way, officials said.

The man was brought to Kings County Hospital with serious but non-life threatening injuries.

"It was a very dangerous operation. They had to shore up that side wall to make sure that wall would not collapse," FDNY Chief of Special Operations John Esposito told members of the news media at the scene.

"We had to cut the beam and lift him, digging by hand to get him out," Esposito added.

The building was purchased by a church next door several years ago and had racked up several violations.

The buildings department said it had approved an emergency order to demolish the structure due to dangerous conditions but final permits had not been issued.

"I haven't seen anything. It's been pretty quiet, there haven't been people going in or out, as far as I'm concerned," a neighbor said. "If it was abandoned and someone was there without permission, that's not safe."

As of Monday around 8 p.m., the building remained insecure as the building department continued to investigate.