Wall Street edged lower

on Thursday as housing and financial stocks lost ground after weaker-than-expected housing data gave investors reason to pause after a recent rally.

Housing-related stocks declined after data showed sales of new single-family homes fell for the first time in four months in December and were below Wall Street expectations. The data followed Wednesday's soft pending home sales report and dented optimism that the housing market may have reached a bottom.

Clearly we have had some decent housing data. (But) now we've had, a little bit today and yesterday, a potential slowdown, said Ryan Detrick, senior technical strategist at Schaeffer's Investment Research in Cincinnati.

It does seem like a little bit of profit-taking on the weak housing data.

Toll Brothers Inc lost 2.7 percent to $22.61. The PHLX housing sector index <.HGX> dipped 0.8 percent. Banks, which stand to benefit from a recovery in housing, also fell. The KBW Bank index <.BKX> dropped 1.5 percent. SunTrust Banks Inc shed 4.5 percent to $20.65 after Deutsche Bank lowered its rating on the stock.

Stocks rose at the start of the session after data showed orders for durable manufactured goods rose more than expected in December, while unemployment benefit claims last week rose only moderately.

The Federal Reserve's vow on Wednesday to keep interest rates near zero at least until the end of 2014 also underpinned stocks, leading investors to bet more money would be driven into risky assets. The benchmark S&P index was up more than 5 percent for the year.

Caterpillar Inc kept the Dow in positive territory as its shares gained 3.5 percent to $112.89. The manufacturer posted a jump in quarterly earnings that far exceeded Wall Street expectations on increased global demand for construction machinery and mining equipment.

The Dow Jones industrial average <.DJI> gained 40.11 points, or 0.31 percent, to 12,797.07. The Standard & Poor's 500 Index <.SPX> slipped 0.93 point, or 0.07 percent, to 1,325.12. The Nasdaq Composite Index <.IXIC> shed 1.50 points, or 0.05 percent, to 2,816.81.

3M Co , a conglomerate with operations throughout the economy, reported higher-than-expected quarterly earnings as demand from industrial and transport markets offset weak sales to makers of consumer electronics. The shares rose 1.6 percent to $87.90.

This is one of the busiest weeks of earnings season, with 117 S&P companies expected to report. According to Thomson Reuters data, 59 percent of the 152 companies in the S&P 500 that have reported earnings beat analysts' forecasts, down from the 70 percent beat rate in recent quarters at this stage.

AT&T Inc posted a $6.7 billion quarterly loss on a break-up fee for its failed T-Mobile USA merger and a pension-related charge on top of costly subsidies for smartphones. The shares fell 2 percent to $29.61.

Amgen Inc's shares fell 1.3 percent to $68.32 and weighed on the Nasdaq after the world's largest biotechnology company said it would pay more than $1 billion to buy Micromet Inc , a deal that would give it access to the company's novel cancer treatment technology.

Micromet's shares jumped 31.9 percent to $10.92 and were the most heavily traded on Nasdaq.

(Reporting By Chuck Mikolajczak; Editing by Kenneth Barry)