KB Home on Tuesday posted a narrower quarterly loss, helped by an improved operating environment for homebuilding.

The top-five U.S. builder reported a loss of $54.7 million, or 71 cents per share, compared with a loss of $58.1 million, or 75 cents per share, a year earlier.

Revenue slumped 14 percent to $264 million.

Encouraging data in recent months suggest that a number of housing markets may be stabilizing or starting to rebound, said Chief Executive Jeffrey Mezger.

Based in Los Angeles, KB operates in 10 states and 30 markets.

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