A massive explosion at a Queens home early Thursday morning sent several New York City police officers flying through the air while they were responding to a call involving a knife and a suspected gas leak, the NYPD said. Police treated eight officers for minor injuries that included burns and at least one head laceration, and authorities said the people inside the building have been accounted for.

In body-camera footage released by police, officers can be seen approaching a small home shortly before 3 a.m. as one officer begins to open the door when a blast erupts. The explosion blows out windows and knocks the officers back across a yard and into a gate, after which they scramble through debris, checking whether anyone has been hurt.

After the initial chaos, the video shows officers helping two young children out of the home while other people stagger out of the building. Later, Assistant Chief Christopher McIntosh of the NYPD addressed reporters and described the officers’ survival as fortunate.

“I want to be clear: We got very lucky today, alright,” McIntosh said at a news briefing hours later. “This could have turned out really differently.” He added, “Thankfully, today, luck was on their side,” describing the outcome for the officers.

McIntosh said the man who led to the initial call arrived at the home intoxicated and carrying a knife, as well as two garbage bags filled with canisters containing an “unknown substance.” He said the man pushed an air conditioning unit to get into a basement apartment where his wife, daughter and two grandchildren live.

According to the NYPD, the family members were eventually able to flee from the building, and officers arrived shortly after that. McIntosh said the man who started the incident is unaccounted for.

Officials said the home collapsed after the blast, and that neighboring homes were also damaged. Police said several people inside the building were taken to a hospital, while officers were treated for minor injuries.