Stocks rose on Tuesday to fresh 2009 highs after stronger manufacturing and retail sales data boosted commodity prices and shares of companies in the materials sector.

The improvement in retail sales in August reassured investors about a rebound in demand, needed for the U.S. economy to snap out of recession. A rise in the government's Producer Price Index signaled increased consumption of raw materials.

Metals prices rose, sending shares of aluminum company Alcoa , AK Steel and US Steel up more than 6 percent. The Reuters-Jefferies CRB index of commodity prices <.CRB> jumped 2 percent for its biggest gain in more than a month, while the S&P materials sector <.GSPM> added 2.3 percent.

The rise in producer prices and a report showing stronger New York state manufacturing suggested demand is building there for raw materials, said Peter Jankovskis, co-chief investment officer at OakBrook Investments LLC in Lisle, Illinois.

The Dow Jones industrial average <.DJI> rose 74.59 points, or 0.77 percent, to 9,701.39. The Standard & Poor's 500 Index <.SPX> gained 5.61 points, or 0.53 percent, to 1,054.95. The Nasdaq Composite Index <.IXIC> added 12.49 points, or 0.60 percent, to 2,104.27.

A stronger-than-expected rise in retail sales notwithstanding, shares of retailers got hit by disappointing results from Best Buy Co Inc and Kroger Co , both of which reported quarterly profits below expectations.

Shares of electronics store Best Buy fell 5.1 percent to $38.34 while grocer Kroger slid 8.2 percent to $20.29. The S&P Retail index <.RLX> was down 0.25 percent.

It was the first time the S&P 500 rose above 1,050 since early October.

Shares of General Electric jumped 3.9 percent to $15.95, helped by an upwardly revised price target from Bernstein Research. The conglomerate's sharp rebound of about 170 percent from its 2009 lows could be a harbinger of more gains for the broader stock market in the months ahead, said Richard Ross, global technical strategist at Auerbach Grayson.

The Nasdaq got a boost after analysts' upgrades of Web auctioneer eBay and Internet company Yahoo . Yahoo shares climbed 4.8 percent to $16.31 while eBay added 1.7 percent to $24.24.

Federal Reserve Chairman Ben Bernanke, speaking at the Brookings Institution on the one-year anniversary of the collapse of Lehman Brothers , said the recession is very likely over.

(Additional reporting by Ellis Mnyandu; Editing by Kenneth Barry)