Stocks closed higher following a late rally led by telecom and energy as investors took surging crude-oil prices in stride.
"I'm thinking the next move is to the upside again," James Paulsen, chief investment strategist with Wells Capital Management, told CNBC. "We've been worrying a lot of stuff as we close out the quarter ... I think it sets up the chance that all of those could turn out better than expected."
Nine of 10 sectors in the S&P 500 closed in positive territory with technology standing out as the day's only laggard. Telecommunications led upside movers, gaining on news of a federal contract worth up to $48 billion, followed by strong gains in energy and financials stocks. Negative sentiment hit the chip industry, pulling down the tech sector.
The markets opened higher on solid economic data but steadily lost ground late this afternoon when oil futures trading closed.
"Part of it was the relief that oil didn't close higher than it actually did and there was some window dressing because it's the end of the quarter," said Charles Rotblut, senior market analyst at Zacks.com. "I think we will end the year higher but at the same time we don't have that much risk priced into the market."
Oil futures closed on the New York Mercantile Exchange up $1.95, or 3%, to $66.03 a barrel, the eighth straight day of gains and highest close since early September.
"It's crude oil, without a doubt," said Dan McMahon, head of listed trading at CIBC World Markets, in an interview with CNBC.com. "It had been taken off people's radar screens, but people are focused on the Middle East again. Largely, as crude goes, so will the market."
"I don't see a big market move to the upside in the near term," Stuart George, head of equity trading at Delaware Investments, told CNBC.com. "The market will not do anything positive until you get past this tension with Iran and Britain."
RF Micro Devices warned that a slowdown in demand from a top-tier customer will hurt its operating results for the first quarter, sending shares down sharply.
Flash memory maker SanDisk declined 3% after Citigroup said industry weakness may persist through the first half of 2007. Shares of larger rival Micron also fell. Elsewhere, Nvidia and Linear Technology also saw declines wider than 2%.
The U.S. government selected AT&T, Qwest Communications International and Verizon Communications on Thursday in the largest federal telecom contract ever. The 10-year deal to overhaul the government's telecommunications services is potentially worth up to $48 billion.
Lone Star Technologies shares soared on Thursday after U.S. Steel said it will buy the oil services firm in a $2.1 billion cash deal. Lone Star makes welded pipe used in oil fields.
Citigroup traded higher after the financial services giant was hired by U.K. bankBarclays to advise on its proposed takeover of ABN Amro, quashing any speculation that Citigroup could make a counter bid for the Dutch bank. Citigroup also said it plans to double its outlets in China this year. Shares of fellow Dow component and financial rival JPMorgan Chase also gained.
UnitedHealth Group declined 3% amid a surge in trading volume following a downgrade by UBS. The research firm cut its rating on the stock to "neutral" from "buy" and said there is little room for outperformance due to sluggish sales and out-sized government exposure.
Gross domestic product expanded at a slightly higher-than-expected annual rate of 2.5%, the government said this morning, in its final revision of fourth-quarter economic performance.
"The GDP number we saw this morning indicates we clearly want to go higher," Peter Kenny, managing director with Knight Equity Markets, told CNBC. "The Dow ... has been very, very strong this year."
Treasury prices moved slightly lower, sending yields higher.
Stocks See Broad Rallies in Europe, Asia
The London FTSE-100, , Paris CAC-40 and Frankfurt DAX all posted solid gains on Thursday.
Private equity firm Blackstone Group is considering a possible counter-bid for British drugs retailer Alliance Boots, the Daily Telegraph reported, citing sources familiar with the matter.
Another private equity firm and FTSE-100 component, 3i Group, said it plans to return $1.57 billion more in cash to shareholders, thanks to a strong returns over the past year.
Tokyo's Nikkei 225 Average clawed its way back into positive territory, ending slightly higher, with exporters such as NEC, Hitachi and Toshiba reversing morning losses despite the stronger yen. The dollar had suffered its biggest slide against the Japanese currency in two weeks after Bernanke's comments.
In South Korea, Kospi Index ended up more than 1% with shipbuilders rallying amid expectations for solid earnings this year. But gains were capped by exporters such as Samsung Electronics falling on continued worries about slowing sales to the key U.S. market.
Hong Kong stocks closed higher after a slow start to trading. Oil producer CNOOC raced higher ahead of its earnings report results for the second half of 2006.