Residential buildings in New York City could soon face routine inspections based on their structural risks to ensure they won’t crumble.

The City Council passed a bill on Thursday that requires the city Department of Buildings to establish a proactive inspection program for identifying potentially hazardous buildings through predictive data analytics, including code violation and compliance history and engineering professionals’ disciplinary records.

The bill also requires the city’s buildings commissioner to set rules for when corrective action plans are necessary after proactive inspections are completed, and the department would have to conduct follow-up inspections to verify improvements. Critics of the current buildings inspections process say it's insufficient because it depends on the city receiving complaints.

The move comes after New York City has experienced several building collapses over the past year, including a partial building collapse in the Bronx that uprooted dozens of families and the toppling of a Manhattan parking garage that killed one of its longtime managers.

“We can not rely on reactive approaches to keep New Yorkers safe in their homes and in their places of work,” said Councilmember Pierina Sanchez of the Bronx, the bill’s primary sponsor, at a press conference ahead of the vote. “In a novel approach, Intro-904 will require the city to identify and act on issues before they become major problems.”

Sanchez said the apartment building that partially collapsed in Morris Heights last December was neglected for years and racked up numerous violations that city agencies largely ignored until the building's side crumbled. While no one was killed in that incident, more than 150 people were temporarily displaced. The collapse of the nearly 100-year-old parking garage in the Financial District last April injured several people.

According to the City Council, the median building age in the city was 90 in 2017. And while sudden building collapses are rare in New York City, the recent incidents have left many residents, officials and housing experts concerned about the city’s aging housing stock.

Mayor Eric Adams' administration said it supports Sanchez's bill and will invest an additional $4.7 million in the Department of Buildings to set up the new inspection program. In a statement on Thursday, Buildings Commissioner Jimmy Oddo called the measure "transformative."

"Too many times, we have seen careless property owners fail to keep their buildings safe and neglect their responsibilities," Oddo said. "DOB must go on the offense against these bad actors so that we can effectively intervene before a tragedy occurs."

The legislation was cosponsored by 10 other councilmembers besides Sanchez.

This story has been updated with comment from the Department of Buildings.