Stocks rose on Tuesday as data showing the biggest monthly jump in consumer confidence in six years lifted hopes of an economic rebound, and a brokerage upgrade of Apple Inc drove sharp gains on the Nasdaq.

Apple's shares jumped 6.5 percent, as Morgan Stanley said the company will see iPhone-driven growth over the next two years and raised its price target on the stock.

An index of U.S. consumer confidence rose more than expected in May and registered its biggest monthly jump since April 2003, according to the Conference Board, an industry group.

Today the market is celebrating the return of some sign of consumer confidence, said Peter Kenny, managing director at Knight Equity Markets in Jersey City, New Jersey. It was so strong, even the dismal housing numbers couldn't hurt the market.

Consumer discretionary shares were among the top gainers on the Dow and S&P 500, with McDonald's Corp up 3 percent.

Consumer spending accounts for roughly two-thirds of the U.S. economy. The U.S. confidence data followed similarly rosy consumer reports in Germany and France.

The Dow Jones industrial average <.DJI> was up 207.16 points, or 2.50 percent, at 8,484.48. The Standard & Poor's 500 Index <.SPX> was up 23.47 points, or 2.65 percent, at 910.47. The Nasdaq Composite Index <.IXIC> was up 56.77 points, or 3.36 percent, at 1,748.78.

The market's gains came after four straight days of losses that marked the Dow's longest losing streak since the five days ended March 3. Worries about a possible cut to the United States' credit rating on Friday had pressured stocks.

Other data on Tuesday showed prices of single-family homes fell in March from a year earlier. The pace of decline, however, slowed for a second consecutive month.

Homebuilder DR Horton's shares rose 6.3 percent to $9.58.

On the Nasdaq, Apple shares were up 6.5 percent at $130.41. On the New York Stock Exchange, McDonald's shares were up 3 percent at $58.77.

Geopolitical concerns over North Korea's latest nuclear and missile tests weighed on stocks in early trading.

(Editing by Leslie Adler)