U.S. stocks advanced on Tuesday on an uptick in corporate deal activity while the weak dollar led to gains in commodities, lifting shares of oil and mining companies.

Kraft Foods Inc , North America's biggest food company, said it was intent on pursuing Britain's Cadbury despite the confectionary company's rejection of a $16.7 billion Kraft bid made on Monday.

Although Kraft's stock fell nearly 6 percent, other food companies rose, including Hershey Co , which added 1.3 percent to $39.14.

Ever since the market's big rally, a lot of folks have been concerned about valuations. But when you see a bid like this, it eases those fears, said Bruce Bittles, chief investment strategist at Robert W. Baird & Co in Nashville, Tennessee.

The dollar fell to its lowest this year against the euro, pushing oil up 4.5 percent and gold temporarily above $1,000 an ounce.

Chevron rose more than 2 percent to $70.48, leading the Dow higher, and Freeport-McMoRan Copper & Gold Inc gained 3 percent to $68.00.

The Dow Jones industrial average <.DJI> closed up 56.07 points, or 0.59 percent, at 9,497.34. The Standard & Poor's 500 Index <.SPX> rose 8.98 points, or 0.88 percent, at 1,025.38. The Nasdaq Composite Index <.IXIC> gained 18.99 points, or 0.94 percent, at 2,037.77.

The S&P 500 index has posted a 52 percent rally from its multiyear low in March, and analysts still gave an upbeat outlook for the benchmark.

David Bianco, Bank of America Merrill Lynch's chief US equity strategist, said in research note on Tuesday that the index should hit 1,200 over the next 12 months because of strong earnings growth.

The firm also is raising its earnings per share estimates for 2009, 2010 and 2011, with increases in the financial sector helping to support growth.

Earlier in the day, market research firm Birinyi Associates also said that the benchmark index could close the year at 1,285. The last time S&P 500 was above 1,200 was September 2008.

The Kraft bid comes after France Telecom and Deutsche Telekom announced plans to merge their British mobile units.

Last week, Walt Disney Co's said it will buy Marvel Entertainment Inc for $4 billion, fueling hopes of a pick-up in merger activity.

The news of the rebuff sent Kraft shares down 5.9 percent to $26.45, but speculation about potential suitors for Cadbury buoyed the overall market sentiment.

Also in the oil sector, Exxon Mobil gained 2.1 percent to $70.65.

Health insurance stocks <.HMO> slid 1.6 percent before U.S. President Barack Obama's address to Congress on Wednesday. He is expected to outline his proposed revamp of the healthcare system.

Shares of General Electric Co advanced 4.5 percent to $14.50 after J.P. Morgan Securities upgraded the stock.

On the Nasdaq, shares of iPod maker Apple Inc rose 2.6 percent to $172.93 after Morgan Stanley raised its price target to $200 from $195. The Morgan Stanley also raised the U.S. systems and PC hardware sector.

After the closing bell, Barrick Gold said it will issue $3 billion in stock and use the proceeds to buy back all of its fixed-price gold hedges and a portion of its floating hedges.

Volume was light on the New York Stock Exchange where 1.32 billion shares changed hands, below last year's estimated daily average of 1.49 billion.

On the Nasdaq, about 2.01 billion shares traded, also below last year's daily average of 2.28 billion.

Advancing stocks outnumbered declining ones on the NYSE by a ratio of about 22 to 7. On the Nasdaq, about 16 stocks rose for every 10 that fell.

(Editing by Kenneth Barry)