U.S. stocks gained on Tuesday for the first time in three days after Wal-Mart Stores Inc. released higher-than-expected fourth quarter results and energy stocks climbed led by oil which surpassed $98 a barrel.

Retailing giant Wal-Mart reported a 4 percent rise in fourth-quarter profits, beating Wall Street expectations. Exxon Mobil Corp., the biggest U.S. fuel company, and Freeport-McMoRan Copper & Gold Inc., the world's second-largest copper producer, advanced.

American International Group Inc. led gains in the Dow Jones Industrial Average on speculation the insurer will recoup losses.

The Standard & Poor's 500 Index added 8.87 points, or 0.7 percent, to 1,358.86 as of 10:55 a.m. in New York. The Dow average rose 88.74, or 0.7 percent, to 12,436.95. The Nasdaq Composite Index gained 12.06, or 0.5 percent, to 2,333.86. The U.S. market was closed yesterday for Presidents' Day.

On the New York Mercantile Exchange, crude for March delivery added $2.75 to $98.25 a barrel on speculation OPEC will curb production and refinery disruptions may limit fuel supplies.

Exxon gained $2.40 to $87.77 while Freeport-McMoRan added $5.31 to $98.45.

AIG, the world's largest insurer, rose $0.98, or 2.13 percent, to $47.09 for the biggest gain in the Dow average. The gain came after a report in Barron's said that the insurer is likely to recover $4.88 billion in losses from credit-default swaps.