In Flatbush, Brooklyn, a three-story apartment building gave way shortly after 4 p.m. Wednesday and fell into an excavation area on an adjoining lot. Officials reported at least two deaths and 17 injuries. Emergency personnel were still looking through the wreckage early Thursday for anyone who might have survived.

Fire Commissioner Lillian Bonsignore said four injured people were in critical condition and seven children were among those hurt. Authorities had not established how many people, if any, were still missing, and said the operation could last several days.

The building contained four apartments and a ground-floor commercial space, according to city information. The collapse also tore away part of a nearby building’s exterior wall, leaving rooms and a staircase exposed.

What is happening at the scene?

Search teams brought in dogs, drones, helicopters and fire trucks, along with heavy equipment to move debris. Floodlights illuminated the work overnight, and an excavator was still digging through the wreckage Thursday morning.

People gathered near the site, including relatives and coworkers of construction workers who had been working when the building fell. Rev. Alfred J. Joseph, a pastor whose church is across the street, expressed hope that anyone trapped could be rescued alive.

Flatbush Avenue was shut between Clarendon Road and Bedford Avenue. Officials urged people to stay away from the area.

What is known about the site and inquiry?

Mayor Zohran Mamdani said the city Department of Buildings and law enforcement would investigate what caused the collapse. Officials had not announced a cause.

The Buildings Department said developers had permission for excavation and foundation work on the adjoining property. Buildings Commissioner Ahmed Tigani said excavation was underway there when the apartment building fell. The site is now subject to a full stop-work order.

The neighboring lot previously held a one-story building. In March, the department directed the owner to stop demolition because protections for nearby properties were inadequate. The agency lifted that order in August after finding that the project team had addressed the violations.