How long will the party last for homebuilders?

July 27, 2012, 1:00 PM UTC

FORTUNE — It’s been a rough five years for the nation’s homebuilders. Following the housing crash, they battled inventory gluts, tumbling home prices, a decimated economy, and a sharp pullback in demand.

But it appears they’re back. Big time.

A surge in new home orders, low mortgage rates, a significant drop-off in housing inventory, and an uptick in home prices are fueling shareholder optimism. Shares of homebuilding stocks have surged 49% on average in 2012 in anticipation of the big rebound, according to UBS analyst David Goldberg. Some builder stocks have soared even higher, such as Standard Pacific (SPF), which has almost doubled in price, and Hovnanian, which is up 70%.

But Goldberg wonders if the rebound is now priced into the stocks. “There’s a lot priced into the group now that is in excess of how things are going to play out in earnings potential and growth,” he says. Still, he believes the sector has bottomed and home prices are moving up.

MORE: Questioning Weill’s big bank break-up payday

This isn’t the first time market watchers have predicted an industry rebound since the housing crash began in 2007. Builders rallied in 2010 over similar rebound expectations, but sold off by the fall of that year when the spring selling season flopped and the recovery failed to materialize after a tax-credit program expired.

But this latest rebound has two things going for it that may make it stick:  Multiple months of order growth, and rising home prices. Orders — a key metric that reflects demand and future revenue for homebuilders — turned positive in the third quarter of 2011 and have been steadily rising every quarter since then. They rose 12% on average in the 2011 third quarter, 14% in the fourth quarter, 23% in the 2012 first quarter, and are on track to be up 30% in the second quarter, according to Alex Barron, founder and senior research analyst at Housing Research Center LLC, an independent housing research firm in El Paso.

Some individual homebuilders have reported even higher orders in the latest quarter:  Lennar (LEN) saw orders spike 40%, Meritage (MTH) 49% and Hovnanian (HOV) 52%.

The uptick in demand comes as housing fundamentals appear to be recovering. Indeed, the glut of unsold homes that caused havoc in the market over the past five years has largely dissipated to more normal levels. The number of new unsold homes on the market is down 71% from its 2007 peak while the supply of existing unsold homes has shrunk 32%, says Fitch Ratings Managing Director Bob Curran.

MORE: Wall Street’s investment du jour: Foreclosed homes

So, what’s caused inventory to shrink and housing demand to increase when the economy has been so rocky?  First, mortgage rates have remained at or near historic lows, making it attractive for fence-sitters to jump into the market. Second, the surge in rents at apartment buildings in recent years has caused renters to start moving back into the homeownership arena. Third, institutional investors, wanting to cash in on rising rental rates, have started gobbling up foreclosed homes at fire sale prices and then renting the homes back to the foreclosed owners rather than flipping them for a quick profit.

“They’re buying foreclosures in bulk,” says Barron. “Places like Vegas and Phoenix that used to be flooded with foreclosures – if you try to find one on the MLS, good luck, and even if you find one, there will be 20 offers on it.”

Even pricing is starting to recover. A report by real estate firm Zillow this week showed prices rose 0.2% in the second quarter – the first quarterly increase since 2007. Phoenix, Miami, Denver and San Jose saw the biggest year-over-year gains, where prices rose 12.1%, 6.4%, 3.5% and 3.4% respectively.

Home prices in major markets are currently at 2003 levels, according to Case-Shiller. “At 2003 levels, there is the potential for a really robust rebound,” says Goldberg.

All this bodes well for the country’s largest homebuilders. Housing starts climbed to a seasonally adjusted annual rate of 760,000 units in June – up 6.9% from May and up 24% from a year ago – its fastest pace of new construction since October 2008, according to the National Association of Home Builders. Goldman Sachs analyst Joshua Pollard, who raised his rating on homebuilders to ‘Attractive’ from ‘Neutral’ this week, is predicting housing starts will climb to 1 million in 2013 and 1.4 million in 2015.

MORE: The downside of rising home prices

Homebuilders that cater to move-up buyers and have low debt stand to see the biggest earnings growth and stock rebound, says UBS’s Goldberg. Builders with higher debt, such as KB Home (KBH), Beazer (BZH), and Hovnanian whose debt levels range from 77% to 186% of market cap, will likely see a slower rebound, he says.

Of course, all rebound bets are off though if the country heads into a double-dip recession or interest rates surge. But even if this happens, Curran says it’s time to allow the housing sector to sort itself out without further government intervention and incentive programs.

“We need to go through the cleansing process, and as painful as that might be, it’s better than delaying and delaying, which is what a lot of these foreclosure initiatives did – it just delayed foreclosures,” he says. “This led to a market in distress longer than it should have been.”