Wall Street rallied early, then sputtered to a stop Wednesday as rising oil prices deflated the market's enthusiasm over strong earnings from technology firms Hewlett-Packard and Applied Materials. Prices ended mixed, and the Dow Jones industrial average gave up a triple-digit advance to close with a loss.

Investor sentiment seemed to swing toward embracing good news as a buying opportunity, rather than selling on the news for a quick profit as was the case over the past few months. But as oil prices rose and stocks plummeted in late trading, it was clear that Wall Street remained susceptible to any negative news.

Benchmark crude oil traded at a record-high $41.50 per barrel in the futures market, up 96 cents, reviving lingering fears of inflation in the markets.

"We've had strong earnings and have seen oil prices come down a bit over the past few days," said Peter Cardillo, chief strategist and senior vice president for S.W. Bach & Co. "But we need those trends to continue in order to sustain any kind of rally."

The Dow fell 30.80, or 0.3 percent, to 9937.71, after it was up 123.99 earlier in the session. The tech-focused Nasdaq composite index gained just 0.35, or 0.02 percent, to 1898.17. The Standard & Poor's 500-stock index dropped 2.81, or 0.3 percent, to 1088.68.

Hewlett-Packard posted a 34 percent gain in quarterly profit after Monday's session, matching Wall Street expectations. The computer maker, which boosted its sales outlook for the second half of the year, rose 72 cents, to $20.55. Applied Materials fell 21 cents, to $18.64, after spending much of the session in positive territory. The maker of chip-manufacturing equipment announced an 82 percent surge in sales from a year ago and beat analysts' estimates by 3 cents per share.

Bookseller Borders Group beat Wall Street estimates by 2 cents per share on a 10.6 percent increase in sales from a year ago. However, Prudential downgraded both Borders and rival Barnes & Noble because of concerns over the coming year's sales outlook. Borders fell 37 cents, to $22.33, while Barnes & Noble fell 77 cents, to $28.31.

Other Indicators

* The New York Stock Exchange composite index rose 10.63, to 6287.16; the American Stock Exchange index rose 8.14, to 1171.75; and the Russell 2000 index of smaller-company stocks fell 1.70, to 540.86.

* Advancing issues outnumbered declining ones by 7 to 6 on the NYSE, where trading volume rose to 1.54 billion shares, from 1.35 billion on Tuesday. On the Nasdaq Stock Market, advancers outnumbered decliners by 9 to 8 and volume totaled 1.8 billion, up from 1.41 billion.

* The price of the Treasury's 10-year note fell $2.50 per $1,000 invested, and its yield rose to 4.77 percent, from 4.74 percent on Tuesday.

* The dollar fell against the Japanese yen and the euro. In late New York trading, a dollar bought 112.62 yen, down from 114.11 late Tuesday, and a euro bought $1.2019, up from $1.1947.

* Light, sweet crude oil for June delivery settled at $41.50, up 96 cents, on the New York Mercantile Exchange.

* Gold for current delivery rose to $382.90 a troy ounce, from $375.80 on Tuesday, on the New York Mercantile Exchange's Commodity Exchange.