The benchmark S&P 500 closed at its highest level since mid-2008 on Monday, extending gains for a third session as oil prices retreated after a recent rally and data showed further improvement in the U.S. housing market.

The S&P and the Nasdaq both eked out gains, while the Dow closed barely lower.

An industry group reported that contracts for home resales hit a near two-year high in January, lifting the Dow Jones home construction index <.DJUSHB> 1.50 percent, while the PHLX housing sector index <.HGX> rose 1.19 percent.

A drop of about 1 percent in the price of oil relieved concerns that high energy prices could hurt the still-fragile economic recovery. Brent crude ended at $124.17, down $1.30.

Anything above $120 to $130 is clearly the level at which the global economy is going to have a hard time growing at a pace that is consistent with a very robust rate of growth, said Natalie Trunow, chief investment officer of equities at Calvert Investment Management in Bethesda, Maryland, which has about $13 billion in assets.

The S&P 500 has rallied 9 percent since the start of the year. It rose as high as 1,371.94 on Monday, its highest level since June 2008 and topping the previous mark of 1,370.58, a key resistance point, before paring gains.

The Dow Jones industrial average <.DJI> was down 1.44 points, or 0.01 percent, at 12,981.51. The Standard & Poor's 500 Index <.SPX> was up 1.85 points, or 0.14 percent, at 1,367.59. The Nasdaq Composite Index <.IXIC> was up 2.41 points, or 0.08 percent, at 2,966.16.

Though the S&P 500 retreated from the day's high, it still marked its highest close since June 2008.

Oil's recent rally has been driven by worries over disruptions to Middle East supplies due to sanctions against Iran. Energy companies fell with oil prices. Shares of Exxon Mobil ended down 0.1 percent at $87.23.

The fourth-quarter earnings period is in the final stretch. As of Monday, 468 S&P 500 companies had reported results, with 63 percent beating analyst expectations.

On Monday, Lowe's Cos , the world's second-largest home improvement chain, reported higher-than-expected quarterly sales, and its shares rose 0.7 percent to $27.34.

Biotech stocks fell after Dendreon Corp said demand was soft for its high-priced Provenge prostate cancer treatment as the year began, and it forecast low-single-digit sales growth in the first quarter.

Dendreon slumped 20.5 percent to $11.81. The NYSEArca biotech index <.BTK> lost 1.5 percent.

Volume was about 6.3 billion shares traded on the New York Stock Exchange, NYSE Amex and Nasdaq, below the daily average of 7 billion.

The number of declining stocks was about even with advancers on the NYSE, while on the Nasdaq decliners beat advancers by about 13 to 11.

(Reporting By Caroline Valetkevitch; Editing by Leslie Adler)