What: Shares of homebuilder KB Home (KBH 1.94%) surged on Friday after the company reported strong Q2 earnings driven by demand for new homes in its served markets. As of 2:30 p.m. Friday, the stock was up about 10%.

So what: KB Home reported revenue of $623 million, up 10% year-over-year and slightly higher than analysts were expecting. Housing revenues rose 8% during the quarter, driven by a 2% increase in the number of delivered homes and a 6% increase in the average selling price. The average selling price increased by 7.6% on the West Coast, by 7.1% in the central United States, and by 12.1% in the Southeast.

The company reported earnings of $0.10 per share, two cents better than analyst estimates but well below the EPS of $0.27 that KB Home reported during the same quarter last year. Higher costs associated with increased staffing, as well as higher construction costs and pricing pressure in certain markets, led to the decline in earnings.

The value of KB Home's backlog increased by 57% year-over-year, and the number of homes in the backlog rose by 39%. The backlog increased in every region, with the number of homes in the backlog nearly tripling in the Southwest. The company's backlog is now at its highest level since before the financial crisis.

Now what: While KB Home's earnings were slightly above expectations, the substantial growth of the backlog points to even stronger results in the coming quarters. New-home sales are still well below their pre-recession peak, reaching an annualized rate of 517,000 in April compared to 1.29 million 10 years ago, so demand for new homes still has plenty of room to grow. The strength of the backlog is likely the main reason why the stock is up so much today, with investors betting that the continuing recovery in new-home sales will be a boon for KB Home.