KB Home , the fifth-largest U.S. homebuilder, reported a wider-than-expected quarterly loss that included charges to write down land values and a loss related to a bankrupt joint venture in Las Vegas.

Shares of KB, which has operations in nine states, were down 4.2 percent in premarket trading.

This summer marks the fifth anniversary of the U.S. housing slump, which followed years of rampant risky lending and speculation. Now, builders of new homes, which historically have fetched a handsome premium compared to a used house, are facing brutal price competition from the excess supply the housing boom left behind.

Los-Angeles-based KB said it lost $68.5 million, or 89 cents per share, in its second quarter ended May 31, compared with a loss of $30.7 million, or 40 cents per share, a year earlier.

Analysts had expected a loss of 31 cents per share, according to Thomson Reuters I/B/E/S.

According to the widely watched S&P/Case-Shiller home price index released on Tuesday, home prices in 20 cities fell 4 percent year-over-year in April. Economists cautioned that home prices will likely continue to crawl along at low levels, and could fall further, as the battered housing market works through a slew of headwinds like foreclosures that are depressing prices and weak demand due to low consumer confidence.

KB's results include a payment to lenders of $214 million to $225 million to settle legal claims related to Inspirada, a bankrupt housing community near Las Vegas. Once expected to have about 11,500 homes, the project stalled as the Las Vegas housing market collapsed.

(Reporting by Helen Chernikoff, editing by Gerald E. McCormick and John Wallace)