The S&P 500 rose to its highest level in five years, on optimism over dealmaking and data showing rising investor confidence in Germany. The tech-laden Nasdaq composite index rose 21.56 points to a 12-year high of 3,213.59.

Shares of Internet giant Google (GOOG) jumped to an all-time high of $806.84.

Shares of Office Depot (ODP) and OfficeMax (OMX) surged Tuesday after published reports the two office supply retailers are in talks to merge the companies in an all-stock deal. Office Depot rose 9% after being up as much as 20% earlier. Office Max shares rose 20% after trading up as much as 30% earlier.

The yield on the 10-year U.S. Treasury note was flat at 2%, while the price of gold fell 0.3% to $1,604.30 per ounce.

In currency trading, the euro was higher against the dollar at 1.339, while the dollar fell 0.5% to $93.53 against the Japanese yen.

U.S. markets were closed on Monday to observe Presidents' Day. On Friday, the Dow rose 8.37 points to close at 13,981.76, the S&P 500 shed 1.59 points to close at 1,519.79 and the Nasdaq composite fell 6.63 points to 3,192.03.

In European trading Tuesday, benchmark indexes in London, Paris and Frankfort ended higher a day after German economic data showed the continent's largest economy is avoiding recession despite severe slowdowns in most of the 17 nations that use the euro.

The price of crude oil was lower after the head of the European Central Bank described the economic outlook of the 17 countries that use the euro as weak in the near term.

Benchmark crude for March delivery was up 80 cents to $96.66 per barrel in electronic trading on the New York Mercantile Exchange. The contract fell $1.45 to finish at $95.86 a barrel on the Nymex on Friday.