A community coalition declared victory Monday after a nearly nine-year legal battle against a controversial rezoning plan by the city.

"We felt like we were left out of the process from the very beginning, and something that was done without us in mind," said Juan Ramos of the Broadway Triangle Community Coalition.

At issue is affordable housing that was supposed to be created under a 2005 rezoning plan put forward by then-Mayor Michael Bloomberg.

The housing was to be built in the area known as the Broadway Triangle, parcels that border three neighborhoods, Williamsburg, Bushwick and Bedford-Stuyvesant.

The proposed apartments were large, designed to accommodate large, Hasidic Jewish families.

The Broadway Triangle Community Coalition successfully argued the housing would only benefit the predominantly white residents of Community Board 1, not the residents of color in adjacent Community Board 3.

"The whole effect of this rezoning, plus the characteristics of the apartments, would've ensured that minority families statistically could not qualify for this housing."

Now, the city has agreed to return to the drawing board, find a new developer to create nearly 400 affordable units and divide them among both community boards to ensure integration according to the federal Fair Housing Act.

"It will remedy that situation by providing more than double the number of housing units that would have been provided by the Bloomberg-era proposal, and it will do so with a mind toward equal housing opportunity," said Arthur Eisenberg of the New York Civil Liberties Union.

The settlement also says those residents who were displaced since the rezoning have housing lottery preference to come back.

The city will also fund programs to help prevent discriminatory housing practices.

"There are $2.4 million that will be allocated every year for three years, so that's split fairly equally between legal services as well as housing services," said Alex Fennell, network organizer for Churches United for Fair Housing.

"It sets a tone, and it's a signal that this is not tolerable," said Marty Needelman, executive director of Brooklyn Legal Services.

The group says this case sets a precedent for other controversial rezonings citywide.