Two people are dead and at least 17 injured — including seven children — after a 96-year-old Brooklyn apartment building collapsed into an active construction excavation pit next door, and city regulators had every reason to see it coming.

The three-story building at 1321 Flatbush Avenue crumbled around 4 p.m. Wednesday, filling the adjacent construction site with bricks and wood and burying residents and workers under rubble. Four victims remain in critical condition. Fire officials say they still don't know how many people are trapped in the wreckage, and FDNY Commissioner Lillian Bonsignore warned the death toll could rise as search operations stretch on for days.

Department of Buildings records show a summons was issued in April for the construction site along Bedford Avenue and that a stop-work order was allegedly violated — then, according to ABC7 New York,