A state Supreme Court judge has overturned the city's 2018 rezoning of Inwood, dealing a major setback to Mayor Bill de Blasio who has sought to upzone low-income neighborhoods in an effort to create thousands of affordable housing units.

The lawsuit, which was brought last year by a coalition of community and preservation groups, sought to reverse a highly controversial rezoning in what is considered one of the last bastions of affordability in Manhattan. The plan sparked three years of protests and resulted in the city pledging to make an unprecedented $200 million in investments in exchange. All told, the de Blasio administration has said that the rezoning would create or preserve 4,100 units of affordable housing, numbers which housing activists challenged because of income requirements that are often set too high for local residents.

In the decision handed down on Thursday, Judge Verna Saunders found that the city failed to take "a hard look" at the environmental concerns expressed by the community.

“This is about the pushing out and displacement of people of color for the benefit of corporate greed,” said Assembly member Carmen de la Rosa, who grew up in Inwood and represents the district, during an August rally following the court hearing.

As proof, Inwood residents have pointed to real estate speculation that had occurred in the neighborhood once the rezoning had been announced.

The ruling means that the city must effectively go back to the drawing board, and address the eight issues that a community group raised during the public hearing process.

State Senator Robert Jackson, who also opposed the plan, responded to the news in a tweet.

Known as an Article 78 proceeding, such lawsuits are typically not successful for communities fighting redevelopments or rezonings. Back in 2018, the state Supreme Court in Manhattan sided with the city in a case brought by the Legal Aid Society on behalf of East Harlem residents fighting a similar rezoning in their neighborhood.

“We strongly disagree with this ruling which we believe is legally incorrect and contrary to well-established precedent," said Nicholas Paolucci, a spokesperson for the Law Department. "We stand by the City’s thorough environmental review and will challenge this decision so important projects, including building new affordable homes in this community, can proceed.”

The Inwood decision marks the second surprising legal defeat for the city this year. In August, a judge ruled against the city's fast-tracked approval of the infamous Two Bridges project, a massive development that would have dramatically raised the skyline along the Lower East Side and Chinatown waterfront. The estimated $4.5 billion plan, which would have contained 2,700 new residential units, of which 690 units, would be below-market rate, must now go before a full public review process.