The state Court of Appeals issued a decision Thursday that gives a huge break to landlords of rent-stabilized buildings by ruling that they don’t have to re-regulate up to 150,000 market-rate apartments.

Chief Appeals Court Judge Janet DiFiore overturned a two-year-old ruling in the case of Altman v. 285 West Fourth LLC, which could have given tenants the legal grounds for challenging market-rate rents in formerly stabilized apartments, according to the Commercial Observer.

A state appellate judge had ruled in 2015 in the case that an apartment’s rent had to rise above the rent-stabilization threshold of $2,733 a month while a tenant was still living there in order for the rental to be deregulated.

The state Legislature wrote the rule into law a few months later, according to the Observer.

For example, if a rent-stabilized tenant paid $2,000 per month and then moved out, the landlord could increase the rent 20 percent and then spend enough on renovations to justify raising the rent to $3,000 a month, and the next tenant would be entitled to a rent-stabilized lease, costing landlords money.

The court’s decision reversed the 2015 policy and ruling, letting landlords hike the rent and deregulate an apartment once a stabilized renter moves out.

If DiFiore had ruled in favor of tenants, it would’ve given up to 150,000 renters the right to sue their landlords for illegally deregulating their apartments.

Tenants could also win hundreds of thousands in rent overcharge judgments.

“Landlords who had deregulated thousands of units were told that they have to re-regulate apartments and pay back overcharged rents,” attorney Jeffrey Turkel, who repped the landlords, told the website.

“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 case 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.