Wall Street managed to finish an erratic session with a moderate gain Wednesday as investors found some comfort in upbeat data on orders for durable goods, though rising oil prices tempered any optimism.
The Commerce Department said orders for items including aircraft, machinery, cars, refrigerators and computers slipped 0.5% last month, a smaller decline than Wall Street had expected.
Excluding transportation, orders rose 2.5% -- the sharpest increase in nine months. And orders for electrical equipment and appliances soared a record 28%.
But oil's comeback from its lows of the day touched off renewed worries that high energy prices would hurt businesses and their customers.
"It seems that the good news is really being kind of overshadowed by high oil prices," said Richard Sparks, a senior equity analyst at Schaeffer's Investment Research in Cincinnati. "The fear is that higher oil prices might drive us into that recessionary area."
The Dow Jones industrial average rose 45.68 points, or 0.4%, to 12,594.03. The blue chips had been down more than 45 points earlier in the session.
Broader stock indicators also ended higher. The Standard & Poor's 500 index gained 5.49 points, or 0.4%, to 1,390.84, and the Nasdaq composite index moved up 5.46 points, or 0.2%, to 2,486.70.
The Russell 2,000 index of smaller companies climbed 4.07 points, or 0.6%, to 738.46.
Advancing issues outnumbered decliners by about 9 to 7 on the New York Stock Exchange.
Yields on government bonds rose on the news about durable goods. The yield on the benchmark 10-year Treasury note jumped to 4.01% from 3.92% late Tuesday.
The dollar was mixed against other major currencies, while gold prices fell.
Crude futures advanced $2.18 to $131.03 per barrel on the New York Mercantile Exchange after being down nearly $3 earlier in the session.
"There's a lot of commentary especially out of the Fed that the oil prices are rising because of basic demand as opposed to speculation in the market. I think that has a chilling effect on the stock market," said Kim Caughey, equity research analyst at Fort Pitt Capital Group.
A drop of more than $3 a barrel helped stocks finish higher Tuesday, the first day of trading for the week after Memorial Day. But last week, oil reached a record high of $135, and the major stock market indexes lost more than 3% as investors worried that higher energy prices would hold back discretionary spending.
"The consumer's behavior is changing. They're not getting in their car, driving to Wal-Mart and loading up on tchotchkes that they may or may not need," Caughey said.
Average U.S. retail gasoline prices rose to fresh records Wednesday above $3.94 a gallon, according to AAA and the Oil Price Information Service.
In other market highlights:
* Financial shares sank after a Citigroup analyst called the $20 billion in capital recently raised by American International Group insufficient and said the insurer's financial position could worsen. AIG fell $1.71, or 4.7%, to $34.91, for the steepest decline among the 30 stocks that make up the Dow industrials.
* Soft drink bottler Coca-Cola Enterprises fell $1.11, or 5.2%, to $20.20 after warning that weak sales trends in the U.S. were likely to lead to a drop in the company's second-quarter profit and make it difficult to meet its 2008 earnings forecast.
* Several retailers showed strength. Polo Ralph Lauren jumped $7.25, or 12%, to $69 after reporting a 41% jump in earnings for its latest fiscal quarter thanks to higher sales and lower taxes. The company also predicted higher revenue for the current quarter.
* American Eagle Outfitters surged $1.39, or 8.1%, to $18.61 after issuing a second-quarter profit forecast that topped analysts' expectations.
* Overseas, stock indexes rose 0.2% in Britain, 1.1% in Germany and 1.3% in France. Shares fell 1.3% in Japan.