In the largest commercial real estate acquisition deal of the year, Boston Properties reports it is buying a portfolio of four New York City office properties, including the General Motors Building, from Macklowe Properties for a total price of about $3.95 billion. The deal came just in the nick of time to save Macklowe from collapse following Harry Macklowe’s purchase of part of the Equity Office Properties portfolio for $7 billion last year at the height of the market.

The Boston-based office real estate investment trust (REIT) is financing the purchase with about $1.46 billion in cash, the issuance of a $10 million interest in Boston Properties Limited Partnerships, an affiliate of Boston Properties, and by taking on about $2.5 billion in fixed-rate debt.

Boston Properties also is looking for joint-venture partners to finance the deal. After a joint venture deal is finalized, the REIT expects to own about a 49% stake in the properties for which it plans to provide property management and leasing services.

The GM building, the crown jewel of the portfolio, is a 2 million sq. ft. property. On the GM building alone, Boston plans to take on $1.9 billion of secured and mezzanine loans at a weighted average interest rate of 5.97%.

JP Morgan’s equity REIT research group estimates that the price for the GM building alone is about $2.8 billion, or $1,400 per sq. ft., making for a capitalization rate of about 4.5%. “With in-place rents at the GM building and even the other three buildings likely significantly lower than market — we would not be surprised to find out that in-place rents are 50% to 75% of market — the portfolio offers up a pipeline of long-term growth opportunities as leases expire,” according to JP Morgan analysts in a recent report. The market speculation is that the joint venture partners will be Middle Eastern investors and Goldman Sachs, according to JP Morgan.

The massive portfolio also includes 540 Madison Avenue, a 292,000 sq. ft., property; 125 West 55th Street, a 591,000 sq. ft property; and Two Grand Central Tower, a 664,000 sq. ft. property.

Boston Properties expects the deal to close in multiple steps, with the GM building acquisition closing first in June 2008.