Residents say the city promised to refurbish their crumbling St. Nicholas Avenue building in Harlem but instead left them $5.1 million in debt for repairs that were done shoddily if at all.

Now tenants in the seven-story Cliffcrest building are accusing the Department of Housing Preservation and Development of fraud and are fighting foreclosure in Manhattan Supreme Court.

“There’s no way millions of dollars were spent on this building,” said Carlton Burroughs, 52, president of the 51-unit property near West 157th Street. “Someone saw a quick buck, and they took it. We got shafted from the beginning.”

It all started in fall 2001, when residents signed on to an HPD program to convert the rental building into an affordable co-op.

Under the deal, the city would renovate the property and the tenants would buy their apartments and inherit the mortgage that paid for the rehabilitation.

But today there’s a leaking roof, exposed wires, craters in the walls, a boiler that’s too small to heat the property — and nothing indicating a multimillion-dollar rehab.

Residents blast HPD and current US Housing Secretary Shaun Donovan, who was at the helm of the city agency in 2004.

Back then, an HPD engineer admitted in an October 2004 memo that repairs “clearly have not been done, and I question if the contractor intends to complete them.”

“They just didn’t care,” said Tom Winston, a retired MTA bus driver and longtime tenant. “They thought we were poor people and weren’t paying attention.”

The project was backed by a $2.1 million loan from HPD, a $1.4 million Bank of America loan and a $947,500 federal grant.

Construction costs ballooned from $4.5 million to $5.1 million, and residents were each saddled with a mortgage of about $100,000, Burroughs said.

The renovation plan included a new boiler, a new roof and plumbing and electrical upgrades.

But HPD didn’t administer the Cliffcrest project itself. It hired two nonprofits. the Settlement Housing Fund and Urban Homesteading Assistance Board, to oversee the conversion. Each has reaped at least $20 million in contracts with the city in the last decade.

The building is currently in foreclosure proceedings. The tenants’ lawyer, Adam Leitman Bailey, filed a motion against HPD last week to rescind the mortgage and recover at least $6.62 million in damages from the city.