U.S. stocks rallied on Thursday, sending the Dow industrials above the key 9,000 mark for the first time since January, as strong second-quarter earnings and improving home sales data fueled economic recovery hopes.

Early gains were extended after data showed U.S. existing home sales rose in June -- the first time since 2004 that this measure has risen three months in a row. The Dow Jones U.S. home construction index <.DJUSHB> jumped 5.8 percent.

Results from bellwethers like 3M & Co and AT&T Inc on Thursday and eBay Inc a day earlier sparked off a rally that drove the S&P 500 index to its highest level in 2009. The Nasdaq was on track for its 12th straight day of gains, its longest winning streak since 1992.

We're getting good earnings from all different industry groups, said John Schloegel, vice president of investment strategies at Capital Cities Asset Management in Austin, Texas. It's a broad-based rally, not pinpointed by any one industry.

The Dow Jones industrial average <.DJI> climbed 182.51 points, or 2.06 percent, at 9,063.77. The Standard & Poor's 500 Index <.SPX> rose 22.55 points, or 2.36 percent, to 976.62. The Nasdaq Composite Index <.IXIC> jumped 48.10 points, or 2.50 percent, at 1,974.48.

3M's stock rose 6.2 percent to $68.65 and contributed the most to the Dow's gain, after the diversified manufacturer handily beat analysts' expectations, and lifted its revenue outlook for 2009.

Blue-chip AT&T's stock shot up 3.1 percent to $25.62 after it reported a smaller-than-expected drop in quarterly profit as strong sales of Apple Inc's iPhone helped increase wireless subscriber growth.

Among the Nasdaq's major advancers was eBay, whose second- quarter results beat Wall Street's expectations. The online marketplace's stock leapt 8.5 percent to $21.11.

The string of good news handily pushed the S&P 500 over a critical technical resistance level of 960, a development that some analysts said is an indication that the benchmark index will take aim at the 1,000 mark.

This is a significant crack of overhead resistance and it's causing a lot of investors to panic buy right now. They're forcing themselves in because they're underweighted and underinvested when the market is making significant headway, Schloegel said.

Only two of the 30 Dow components were trading lower in the early afternoon, with the decliners led by McDonald's Corp , down 4.9 percent at $55.97. Earlier in the day, McDonald's, the world's largest hamburger chain, reported lower quarterly profit and lower sales compared with a year ago.

Shares of Moody's Corp fell 2.6 percent to $25.82 after hitting an intraday low of $23.70 earlier, following news that Warren Buffett's Berkshire Hathaway Inc reduced its stake in the credit ratings provider.

Earlier on Thursday, U.S. government data showed claims for jobless benefits rose last week, roughly in line with expectations, while continuing claims declined.

Other companies expected to report quarterly earnings on Thursday include Amazon.com Inc , American Express Co and Microsoft Corp .

(Editing by Jan Paschal )