Stocks edged higher Wednesday after a government report showed stronger demand for gasoline.
Indexes had been lower earlier in the day but rallied after an Energy Department report showed that gasoline consumption continues to grow despite sharp price increases at the pump. It's a possible sign that motorists have handled higher fuel costs without cutting back.
Economists have been concerned that the recent spike in oil prices could imperil the economic recovery.
Oil prices reached their highest level since Sept. 26, 2008. West Texas Intermediate crude rose 78 cents to settle at $105.75 per barrel.
Stocks had been weighed down by news that the earthquake and tsunami that hit Japan will be the most expensive natural disaster in history. Financial stocks were lower after the Federal Reserve rejected Bank of America's plan to increase its dividend.
The Dow Jones industrial average rose 67.39 points, or 0.6 percent, to close at 12,086.02.
The Standard & Poor's 500 index edged up 3.77 points, or 0.3 percent, to close at 1,297.54.
The Nasdaq composite index rose 14.43, or 0.5 percent, to 2,698.30.
The Japanese government estimated that rebuilding costs for the earthquake could be as high as $300 billion. The widespread devastation is expected to drag the growth rate of the Japanese economy down by 0.5 percent this year. Japanese companies such as Toyota and Honda have suspended production at some plants.
Bank of America Corp. fell 1.7 percent after the Federal Reserve rejected its plan to raise its dividend in the second half of the year. The Fed allowed several major banks to increase their dividends last week after they passed stress tests. Banks slashed their payments to shareholders during the financial crisis to save cash. Bank of America said it expects to submit another request to increase its dividend this year.
Rising shares outpaced falling ones by a slight margin. Consolidated trading volume was 3.9 billion shares.