The New York State Court of Appeals handed down a landmark ruling today that favors landlords of rent-stabilized buildings by preventing them from having to re-regulate as many as 150,000 market-rate apartments.

Chief Appeals Court Judge Janet DiFiore overturned a two-year-old ruling in Altman v. 285 West Fourth LLC, which could have given tenants a legal basis for challenging market-rate rents in formerly stabilized apartments. In 2015, a state appellate judge ruled in the Altman case that an apartment’s rent must rise above the rent-stabilization threshold (now $2,733 a month) while a tenant still lives there in order for it to be deregulated. The state legislature wrote the rule into law a few months later.

For example, if a rent-stabilized tenant paid $2,000 a month and then moved out, the landlord could increase the rent 20 percent and then put enough money into renovations to justify raising the rent to $3,000 a month. But the next tenant would still be entitled to a rent-stabilized lease, even though the rent had risen above the deregulation threshold of $2,733. Today’s decision reverses the 2015 policy and ruling, allowing landlords to jack up the rent and deregulate an apartment once a stabilized renter moves out.

If the latest ruling had swung in favor of tenants, it would have given as many as 150,000 renters a precedent to sue their landlords for illegally deregulating their apartments and potentially allow them to win hundreds of thousands in rent overcharge judgements. But that’s not what happened. Instead, landlords and their lawyers are breathing a sigh of relief, and the real estate industry is rejoicing.

“Landlords who had deregulated thousands of units were told that they have to re-regulate apartments and pay back overcharged rents,” said attorney Jeffrey Turkel of Rosenberg & Estis, who has handled the case on behalf of the landlord for the past year. “Landlords were saying, ‘I have dozens of apartments like this; it’s a catastrophe.’ ” And real estate attorneys were telling buyers of stabilized buildings, “keep in mind that you could owe tons of money and your rent roll will sink by thousands of dollars,” he added.

The legal battle began in 2014, when attorney Robert Altman sued his landlord, arguing that his West Village two-bedroom had been illegally taken out of rent stabilization. He began subletting the apartment monthly for $1,829 in 2004, and the landlord sued him to collect a 10 percent increase for the sublet, which is allowed for rent-stabilized apartments.

After they settled the suit in 2005, Altman agreed to sign a lease for $2,482 a month, which was above what was then the rent stabilization threshold of $2,000. He also signed a rider acknowledging that the apartment would no longer be stabilized, according to court documents. The building changed hands in 2007, and the new owner continued raising Altman’s rent. By 2014, he was paying $4,100 a month, he told real estate blog Brick Underground, and he realized that he could challenge several years’ of rent increases on the basis that the apartment should have remained stabilized for the previous decade. Although he never expected that his minor rent stabilization battle would become a major debate among landlord-tenant lawyers, the 2015 appellate court decision in his case upended what property owners had done for decades when it came to deregulating apartments.

Landlord lawyer Sherwin Belkin of Belkin Burden Wenig & Goldman, who filed an amicus brief on behalf of the Real Estate Board of New York, landlord group Rent Stabilization Association and the Community Housing Improvement Program, argued that the 2015 ruling flew in the face of what the state housing agency had enforced for years.

“That [policy] had not been the real estate industry’s understanding or DHCR’s [Department of Housing and Community Renewal] understanding,” he said, while applauding today’s owner-friendly ruling. “I think that the court of appeals decision was absolutely spot on in both the legal and legislative analysis. It has once again settled what appeared to be a settled issue.”

REBNY also sent out a victorious statement about the Altman decision. John Banks, the trade group’s president, said, “This means that the owners of thousands of rent stabilized apartments which have been deregulated over the last two decades can rest assured with the knowledge that the rules were followed and these units can remain deregulated.”