Politicians and civic leaders are celebrating an extraordinary judicial rebuke to the developer of a 52-story, 112-unit building, the tallest on the Upper West Side.

Manhattan State Supreme Court Judge W. Franc Perry ruled Thursday that the city buildings department should not have issued a permit for the high-rise, 200 Amsterdam Avenue.

He ordered the department to revoke the permit, and directed the developer to demolish all floors that violate the stated zoning limit.

Opponents of the project say the ruling could mean the removal of 20 or more stories.

"This is only the second time a judge had the nerve and the fortitude to say you can't violate the law with impunity, and if you violated the law…off with those stories, off with those floors," New York Rep. Jerry Nadler said at a news conference with community leaders.

Some Upper West Siders are glad the judge sided with the community.

"The neighborhood doesn't need this. We've got a school right behind," Upper West Side resident Nancy McGraw said. "It's just too tall for this area."

"If they tore down the whole thing, it'd be even better," resident Stephen Holden said.

It's common for developers to acquire the unused development rights of adjacent properties so they can build higher and denser than zoning allows. But the tactic was taken to the extreme at 200 Amsterdam Avenue with the creation of a 39-sided lot, which allowed the transfer of more development rights than usual.

(Rendering based off of research from the Municipal Art Society.)

Opponents said it was an abuse of the zoning rules.

"I think it's the end of these very tall buildings," said Olive Freud of the Committee for Environmentally Sound Development. "We want to live in the city. It's a residential area, it's our home. We don't want to live in shadows."

"It is a clarion call that if you twist the law, that ultimately you are going to get stopped," said Elizabeth Goldstein, the president of the Municipal Art Society.

The developer of 200 Amsterdam, SJP Properties, says the decision sets a precedent that could apply to as many as 20 projects across the city. It calls the ruling a "shocking loss" for New York, and says it's confident the decision will be overturned on appeal.

"It defies more than 40 years of precedent in the city's zoning laws. It also ignores the thoughtful decision of the DOB [Department of Buildings] to grant the permit," SJP Properties said in a statement.

The opponents say they're confident the judge's ruling will stand up on appeal.