It was that rare thing: a compromise that made everyone happy. In 1996, the city, state, Park Slope community board, borough president’s office and advocates for the mentally ill all agreed on the fate of a building foreclosed by the Greater New York Savings Bank in the early 1990s. The state Office of Mental Health (OMH) would buy the failed luxury co-op and divide the apartments equally between moderate-income Park Slopers and formerly homeless tenants.

But three years later, the deal still hasn’t been closed, leaving 10 cheap apartments vacant on 1st Street between 4th and 5th avenues, the middle of a neighborhood with a serious real estate crunch.

“The reason this thing is taking so long is that we are trying to be new and innovative, and we’re doing something that’s never been done before,” explained Joseph Lazar, director of the New York City field office of OMH. “It’s a good idea, but unfortunately, there are time constraints, and people learning new tricks. Right now we’re entangled in lawyers trying to work out the details, but it is moving along.”

As written, the arrangement has the Institute for Community Living, which runs supportive housing for the formerly homeless, take over the property. OMH would pay the $1.7 million price tag up front. Since half the building was earmarked for affordable housing, the city housing department would kick in about a third of the purchase price afterward, according to Lazar.

Local residents will apply to live in the 20-apartment building through a lottery run by the Fifth Avenue Committee, a local community development group. Rents will be fixed at $686 for a one-bedroom apartment and $772 for a two-bedroom-well below the trendy Slope’s market rate.

The 10 units reserved for formerly homeless tenants have been rented out for at least three years, says Institute for Community Living executive vice president Harvey Lieberman. But the other half have been held up by negotiations over legal, financial and regulatory fine print between the city housing agency, OMH and the State Dormitory Authority, which oversees such facilities.

And until that deal is done, the apartments stay empty.

“Rental units at these rents, as the result of skyrocketing property values, are desperately needed, and ought be put to use,” said Brad Lander, executive director of the Fifth Avenue Committee, who sent off a barrage of letters last week to state and local officials to move the project along. “Whoever is responsible for [the delay] is doing a disservice to the community. It’s called warehousing.”