The Gotham Organization is in contract to buy a portion of the Midtown West site hosting Covenant House — where it will develop an apartment building and a new facility for the charitable organization.

Gotham, headed by Joel Picket and his son, David, will pay $78 million in stages for the prime site on the southeast corner of 10th Avenue and West 41st Street, The Post has learned.

Eventually, Gotham will develop a “ground-up, mixed-use, mixed-income residential building,” sources said.

But first, Gotham will construct a new, “purpose-built” facility on another portion of the three-building site for the international group that helps at-risk teens.

Covenant House is expected to consolidate operations during construction, with a closing on the land sale expected sometime before the end of 2021.

“The proposed new multi-story facility will enable Covenant House to continue providing its important services, including transitional housing, health and wellness services, and employment and life skills training,” Gotham wrote in an e-mail statement to The Post. “The proposed plan will consolidate the nonprofit’s operations and strengthen its services, while ensuring Covenant House can maintain all operations throughout construction and development.”

The Covenant House locations have long been the target of developers. With the announcement made by Mayor de Blasio at its headquarters, the City’s Economic Development Corp. issued a request for proposals for the entire block in January 2016 that would have included the adjacent former Hunter College building.

But by May 2016, allegations that Covenant House had inflated the number of teens it was serving resulted in the EDC stretching out the RFP process.

“These allegations were proven to be false after an investigation,” said Tom Manning, a spokesman for Covenant House. He added they are “thrilled” with the redevelopment deal done directly with Gotham which has a track record of working with nonprofits.

On Monday night alone, the facility served 240 young adults from ages 18 to 21.

EDC did not immediately respond to requests for comment on the Gotham deal, which was privately negotiated and signed in October.