NEW YORK - Wall Street managed to finish an erratic session with a moderate gain yesterday as investors found some comfort in upbeat data on durable-goods orders.

Oil prices, however, remain a big focus on Wall Street. Crude's recovery from its lows yesterday ate into some of the stock market's enthusiasm over the Commerce Department's durable-goods report. The government said orders for items including aircraft, machinery, cars, refrigerators and computers slipped 0.5 percent last month. Wall Street expected a steeper decline.

But oil's comeback touched off renewed worries that high energy prices will hurt businesses and their customers. Consumer spending accounts for more than two-thirds of U.S. economic activity.

The Dow Jones industrial average rose 45.68, or 0.36 percent, to 12,594.03. The blue chips had been down more than 45 points earlier in the session. The Standard & Poor's 500 index rose 5.49, or 0.40 percent, to 1,390.84, and the Nasdaq composite index rose 5.46, or 0.22 percent, to 2,486.70.

Light, sweet crude rose $2.18 to settle at $131.03 a barrel on the New York Mercantile Exchange after being down nearly $3 a barrel earlier in the session.

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 saw a fresh record of $135, and the major stock market indexes lost more than 3 percent as investors worried that a surge in oil and gasoline prices would dull discretionary spending and upend whatever growth the economy might manage.

"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," Kim Caughey, equity research analyst at Fort Pitt Capital Group Inc., said.

In corporate news, financial shares were among the worst performers in stocks after a Citi Investment Research analyst said that the $20 billion in capital recently raised by American International Group Inc. was insufficient and that the insurer's financial position could worsen. AIG was the steepest decliner among the 30 stocks that make up the Dow industrials. The stock fell $1.71, or 4.67 percent, to $34.91.

Soft-drink bottler Coca-Cola Enterprises Inc. fell $1.11, or 5.21 percent, to $20.20 after warning that weak sales trends in the United States would likely lead to a drop in its second-quarter profit and that meeting its 2008 earnings forecast could be difficult.

Several retailers showed strength. Polo Ralph Lauren Corp. jumped $7.25, or 11.74 percent, to $69.00 after reporting its fiscal fourth-quarter earnings jumped 41 percent because of higher sales and lower taxes. The company also predicted first-quarter revenue would increase.

American Eagle Outfitters Inc. issued a second-quarter profit forecast that topped Wall Street's expectations. The stock gained $1.39, or 8.07 percent, to $18.61.