TRI Pointe Homes is betting the U.S. housing recovery has a firm foundation. It's buying the homebuilding unit of timber conglomerate Weyerhaeuser for $2.7 billion, making it one of the nation's ten largest homebuilders.

The deal comes just when interest rates and home prices have risen, slowing down demand among home buyers. But analysts forecast the market will pick up again in the near term.

Backed by Barry Sternlicht's Starwood Capital Group, TRI Pointe will gain control of 27,000 lots in high-growth markets. The deal will also broaden TRI Point's geographic reach beyond California and Colorado into the Southwest, Washington State and Washington D.C.

To make the deal beneficial tax-wise, Weyerhaeuser will spin or split off its real estate unit, then merge that with a subsidiary of TRI Pointe.

TRI Pointe's shares have shot up 9 percent since Reuters broke the news on October 21 that the two sides were in talks. But the stock has lost nearly a fifth of its value since it went public in January.