In the largest single building sale in history, the General Motors Building will be sold for nearly $3 billion, the buyer said in a statement yesterday.

As The Post first reported Wednesday, Daily News publisher Mort Zuckerman’s Boston Properties is purchasing the 2 million-square-foot Fifth Avenue skyscraper, along with three other office buildings, from the financially troubled Harry Macklowe.

The other buildings are Two Grand Central Tower, 540 Madison Ave. and 125 W. 55th St.

The total price tag is $3.95 billion.

Yesterday’s deal enables Macklowe to pay off a $1 billion-plus loan made by Fortress Investments for which he was personally liable and which had affected his ability to remain solvent.

The effort to sell the GM Building, led by CB Richard Ellis and Citigroup, had been the focus of industry speculation for months.

Zuckerman and his partners, believed to be Goldman Sachs and the Kuwait and Qatar Investment Authorities, are paying $1.5 billion in cash, taking over $2.5 billion in debt and giving Macklowe $10 million in limited operating partnership interests in Boston Properties to avoid some taxes.

The partners were not identified except for Goldman Sachs, which was only identified as an advisor along with Morgan Stanley.

A source close to the deal said the GM Building alone was priced at just under $3 billion.

Macklowe’s lawyer, Jonathan Mechanic of Fried Frank, said the deal was signed in the wee hours yesterday.