KB Home posted a quarterly loss that was not as bad as Wall Street had expected, as orders rose and the builder took a smaller charge to write down the value of its landholdings, sending shares up as much as 12 percent.

The No. 5 U.S. homebuilder said on Friday its net loss narrowed to $58.1 million, or 75 cents per share, in the first quarter ended February 28 versus $268.2 million, or $3.47 per share, a year earlier.

Analysts had forecast a loss of 87 cents per share, according to Reuters Estimates.

KB's orders rose 26 percent to 1,827 in the quarter, fueling the surge in the share price, said FBN Securities analyst Joel Locker.

Both the company and analysts attributed the increase in orders to the burgeoning popularity of its Open Series product, a smaller, less expensive home designed to compete with cut-rate foreclosures.

Orders should grow through the end of the year, by which time Open Series should constitute about half the company's deliveries, Chief Executive Jeff Mezger told analysts on a conference call.

In every community where we transitioned to the new product line, sales of the Open Series exceeded previous sales rates often by a significant order of magnitude, Mezger said.

Credit Suisse analyst Dan Oppenheim said the company's aggressive pricing and move toward smaller, lower-cost homes allowed it to effectively compete with foreclosures and re-sales in today's price-driven market.

Homebuilders have been mired in a protracted downturn, triggered by rampant risky lending practices and exacerbated by rising unemployment associated with the recession.

To endure the slump, builders have focused on generating cash and shoring up balance sheets -- sometimes at the expense of profitability.

KB ended the quarter with $1.13 billion in cash, another reason for investor enthusiasm at the results, Locker said. The company sees positive cash flow from operations for the full year, it said on the call.

A series of recent positive headlines, such as the 4.7 percent rise in new home sales reported this week, has engendered a fragile sense of optimism among both builders and investors. The Dow Jones U.S. Home Construction Index is up about 52 percent since March 6.

We are seeing some signs that the housing market is functioning according to fundamental economic principles, Mezger said during the call. As a result of low prices and low interest rafts, buyers have become more active.

On the other hand, KB's revenue fell 61 percent to $307.4 million, and Mezger said the company does not see any meaningful improvement in market conditions for the remainder of the year.

We think it will be difficult for a while, Mezger said.

KB shares rose 89 cents or 6.3 percent to end at $15.05 on the New York Stock Exchange on Friday, off an earlier high at $15.86.

(Reporting by Helen Chernikoff; Editing by Gerald E. McCormick, Dave Zimmerman and Matthew Lewis)