Stocks advanced on Thursday, sending the Dow industrials above the key 9,000 mark for the first time since January, as strong corporate profits and rebounding home sales spurred optimism about the economic recovery.

The broad-based rally lifted all 10 of the S&P 500'sbenchmark sectors into positive territory.

The market extended opening gains 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.2 percent.

Companies posting strong results on Thursday included 3M & Co , a diversified manufacturer, and telecommunications company AT&T Inc, both Dow components. eBay Inc's quarterly scorecard, released a day earlier, also gave investors reason to be optimistic.

It's been a wonderful run-up here. It's certainly helping to restore investor confidence, given the trauma that people went through, said John Coyne, president of Philadelphia-based Brinker Capital, with $8 billion under management.

What I like about the rally that we've seen so far is the breadth of it. It's not really confined to a single sector. It's broadly spread. That gives me confidence.

The Dow Jones industrial average <.DJI> surged 199.74 points, or 2.25 percent, at 9,081.00. The Standard & Poor's 500 Index <.SPX> climbed 24.09 points, or 2.52 percent, to 978.16. The Nasdaq Composite Index <.IXIC> jumped 49.43 points, or 2.57 percent, to 1,975.81.

The string of good news helped the S&P 500 punch through critical technical resistance level at 960, sparking a rally that lifted the benchmark index to 979.29 -- its highest intraday level in eight months.

That breakout, according to some analysts, was an indication that the S&P 500 could take aim at the 1,000 mark. The S&P 500 is now up 44.7 percent since its 12-year closing low on March 9.

The Nasdaq was on track for its 12th straight day of gains, its longest winning streak since 1992.

3M's stock rose 7 percent to $69.17 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.3 percent to $25.65 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 shot up 10.4 percent to $21.48.

Only three of the 30 Dow components traded lower, including McDonald's Corp . The hamburger chain's stock fell 5.3 percent to $55.72 after it posted lower-than-expected June same-store sales and its quarterly profit matched Wall Street's forecasts.

Elsewhere, shares of Moody's Corp fell 4.1 percent to $25.44 following news that Warren Buffett's Berkshire Hathaway Inc reduced its stake in the credit ratings provider.

Before the bell, U.S. government data showed claims for jobless benefits rose last week, roughly in line with expectations, while continuing claims declined.

Companies still expected to report quarterly earnings on Thursday include Amazon.com Inc , American Express Co and Microsoft Corp . Their numbers are due after the bell.

(Editing by Jan Paschal)