The New York City Council is poised to approve a measure giving nonprofit groups a chance to buy dilapidated apartment buildings before they hit the open market, after years of false starts and failed attempts to pass previous versions of the legislation.

The Council’s housing committee is scheduled to vote Thursday on the Community Opportunity to Purchase Act before sending it to the entire body for a final decision later in the day – all but assuring its approval under a Council tradition of not calling a measure to the floor unless it has the votes to pass.

The measure, known as COPA, would initially apply to about 2,100 buildings citywide with serious safety or financial problems, according to analysis from the Department of Housing Preservation and Development. Supporters say their goal is to allow nonprofits to rehabilitate buildings while keeping rents low and responding to tenants’ needs.

The bill has 33 Council sponsors and the support of Mayor Zohran Mamdani, who has championed the legislation as a way to preserve affordable housing. But it has faced opposition from landlord and real estate groups.

The measure could become the Mamdani administration’s latest tool to steer building sales and promote nonprofit or tenant ownership, following previous efforts to influence a bankruptcy sale of more than 5,000 rent-stabilized apartments and back a bid for another portfolio of buildings in East Harlem.

The legislation would specifically apply to buildings with at least four apartments deemed “distressed” by the city’s housing agency, including those with three or more violations per unit, buildings enrolled in a city housing code enforcement program or properties facing municipal foreclosure due to unpaid taxes and fines.

For buildings covered by COPA, owners will be required to notify the city’s housing agency when they plan to sell. That notice would open a 20-day window for tenant groups, nonprofits and some private developers to express their interest in buying the building and to request financial information from the owner. The potential buyers would then have another 70 days to make an offer, followed by a second period of time to match other outside bids.

Councilmember Sandy Nurse, a Brooklyn Democrat who introduced the current version of the bill, said it will deliver “community control” of properties plagued by serious hazards and financial turmoil.

“It’s creating opportunities for neighbors and communities to fight for buildings that are at risk and creates a small window of time for them to compete,” Nurse said.

Nurse and other supporters have pointed to notorious buildings, like Upper Manhattan properties owned by jailed landlord Daniel Ohebshalom, as examples of sites potentially eligible for the program.

The COPA legislation has long been a goal of tenants’ rights advocates and affordable housing groups who say it could stop private equity firms and other companies from purchasing apartment buildings then squeezing profits by forgoing repairs and maintenance.

But versions of the bill have faced fierce opposition from the real estate industry and landlords groups, who say it will gum up the sales process and hurt property owners with small portfolios.

“COPA will make New York City an affordable housing wasteland and trigger the extinction of small owners,” Small Property Owners of New York Board President Ann Korchak said in a January statement.

Councilmembers approved a version of the bill last year before then-Mayor Eric Adams vetoed it days before leaving office. Council Speaker Julie Menin declined to bring the legislation up for another vote in January after the city Law Department raised legal concerns and some councilmembers dropped their support amid a real estate lobbying campaign.

Menin’s office did not provide comment on the legislation.

In May, Nurse adjusted the bill to shorten the window of time before a COPA-eligible building hits the open market, coaxing support from the industry’s main lobbying group, the Real Estate Board of New York.

In a written statement, Real Estate Board of New York President James Whelan said the group is OK with the Council’s “more targeted and practical bill.”

“We value their commitment to refining the proposal and look forward to continuing to work with the Council to preserve affordable housing, protect tenants and support the creation of more homes for New Yorkers,” Whelan said.