Updated

Stocks surged Wednesday, extending their rally for a fourth session, as bargain hunters scooped in despite the threat of rising  crude price. The Nasdaq composite index up 2 percent ahead of Google Inc.'s (search) much-anticipated initial public offering.

The Dow Jones industrial average (search) finished up 110.32 points, or 1.11 percent, at 10,083.15. The Standard & Poor's 500 Index (search) rose 13.46 points, or 1.24 percent, to 1,095.17. The technology-laced Nasdaq Composite Index (search) climbed 36.12 points, or 2.01 percent, to 1,831.37.

"Last week was a pretty severe week, especially for technology and the last 7 weeks have been pretty tough overall," said Evan Olsen, head of equity trading at Stephens Inc. "There's some money being put to work in some of these areas that have been beaten down pretty severely."

Global fears about terrorism and the premium they've added to oil prices have rattled investors, exacerbating the volatility usually associated with late-summer trading. Analysts remained upbeat about the market's underlying fundamentals, however, and the lack of selling pressure led some to express optimism that the rally, which has lasted through four sessions, might hold.

"People have a tremendous capacity to adapt," said Ken Tower, chief market strategist for Schwab's CyberTrader. "No story stays in the news forever. So it's just possible that the market has now fully discounted higher prices of oil, and is poised to move higher."

Despite the robust performance of tech shares, some analysts questioned the conviction behind the buying. Valuations within the sector, which has been badly bruised, have fallen to attractive levels, but that may not be enough to sustain the rally.

"I wouldn't take today's move as a change in sentiment, or any positive sign at all," said Neil Massa, equity trader at John Hancock Funds. "I think we're still stuck in this trading range. I think investors are truly worried about third and fourth quarter profits. They were expecting a robust recovery ... and it just doesn't look like that's happening."

Investors shrugged off another jump in oil prices. NYMEX crude oil futures (search), which have been traded for 21 years, set a new record at $47.39 before settling at $47.27, after government data showed U.S. oil inventories shrank last week in line with market expectations.

Since the end of June, crude prices have jumped 27 percent or $10 a barrel. Over the same period, the S&P 500 Index has fallen 5.5 percent.

Among oil companies making gains Wednesday, Exxon Mobil Corp. (XOM) added 45 cents to $44.81, or 1 percent, while ConocoPhillips Co. (COP) was up 77 cents at $73.15, also 1 percent.

The Nasdaq was strongly ahead as investors rotated back into tech stocks.

"There's definitely a bit of bargain hunting. We're seeing some groups that have been badly beaten down like airlines and semiconductors working their way back," said Marc Pado, US Market Strategist at Cantor Fitzgerald.

Internet companies eBay Inc. (EBAY) and Yahoo Inc. (YHOO) shook off news that Google had slashed the size of its initial public offering. By the end of the session, Yahoo was up 14 cents at $28.48 while Ebay gained 34 cents to $79.91.

Google Inc. (search) cut the range on its IPO to $85 to $95 per share from $108 to $135, a 26 percent reduction at the mid-point of the range. The IPO of the world's most popular Web search engine is now slated to raise as much as $1.9 billion, far lower than its previous size of as much as $3.5 billion.

Data storage equipment maker Network Appliance Inc. (NTAP) soared 13.3 percent, or $2.31, to $19.70 after it posted a quarterly profit, excluding one-time items, that beat expectations by a penny.

Applied Materials Inc. (AMAT), the world's largest maker of chip-making tools, was finished up 9 cents at $16.16 after reporting better than expected revenues and earnings that beat Wall Street estimates by a penny. Executives described a climate of healthy chip spending, but the company's forecast for the next quarter was somewhat disappointing, giving investors a mixed impression.

Mylan Laboratories Inc. (MYL) added 22 cents to $15.58 after saying it would appeal a ruling revoking approval of its generic pain patch treatment.

The Russell 2000 index, which tracks smaller company stocks, closed up 11.61, or 2.2 percent, at 541.61.

Trading was active, with nearly 1.3 billion shares changing hands on the New York Stock Exchange, just below the 1.4 billion daily average for last year. Almost 1.6 billion shares were traded on Nasdaq, just below the 1.69 billion daily average last year.

Advancers outnumbered decliners on the NYSE by nearly four to one, and on the Nasdaq by almost three to one.

Overseas, Japan's Nikkei stock average finished 0.5 percent higher Wednesday. In Europe, France's CAC-40 closed up 0.2 percent, Britain's FTSE 100 declined 0.1 percent and Germany's DAX index added 0.6 percent.

Reuters and the Associated Press contributed to this report.