A major campaign donor secretly pleaded guilty to trying to bribe Mayor de Blasio to get a sweetheart lease deal for his Queens restaurant, court records unsealed Wednesday revealed.

Harendra Singh — an early supporter of de Blasio’s mayoral bid who raised $27,000 for his 2013 run — made the admission in sealed federal courtroom proceedings in October 2016, pleading guilty to bribery and wire fraud.

“I gave these donations to the elected official in exchange for efforts by that official and other city officials to obtain a lease renewal from the city agency for my restaurant on terms that were favorable to me,” Singh admitted.

A transcript of the exchange refers to Singh’s meeting with a senior de Blasio aide and a city agency head on July 30, 2015 to “pressure” the agency into securing a lease renewal for the Water’s Edge restaurant Singh owned in Long Island City, Queens.

Singh owed $1.7 million and rent and penalties on the city-owned land at the time.

The transcript doesn’t refer to de Blasio or other city officials by name, but the meeting occurred on the same day Singh met with top de Blasio advisor Emma Wolfe and Stacey Cumberbatch, former head of the Department of Citywide Administrative Services.

The city and Singh were close to completing a sweetheart deal when he was arrested as part of a corruption investigation on Long Island, where he also subsequently pleaded guilty to bribing officials.

De Blasio was never charged and a federal investigation into his fundraising ended with no criminal charges. He has repeatedly denied any wrongdoing.

“The allegations against this administration were never proven because they are not true,” said de Blasio spokesman Eric Phillips. “They are old news that’s been widely reported and reviewed extensively by federal prosecutors before they closed their investigation. We make decisions on the merits. Period.”

But while no charges were brought, both the US Attorney’s Office and the Manhattan DA Cy Vance slammed de Blasio’s shady fundraising practices.

Then acting-US Attorney Joon Kim pointed to “several circumstances” in which de Blasio “made or directed inquiries to relevant city agencies on behalf of” donors seeking favors.

“This conclusion [no charges being filed] is not an endorsement of the conduct at issue; indeed, the transactions appear contrary to the intent and spirit of the laws that impose candidate contribution limits,” Vance said at the time.