IE 11 is not supported. For an optimal experience visit our site on another browser.

Dow, S&P 500 at 5-year highs; Nasdaq also soars 

Stocks finished modestly higher across the board Tuesday, with the Dow and S&P 500 logging fresh five-year highs, lifted by optimism for more M&A deals and after positive economic data from Europe.

U.S. markets were closed on Monday for Presidents Day.

The Dow Jones Industrial Average finished above the psychologically-important 14,000 level, led by Cisco and Merck. The Dow is within 1 percent of its all-time closing high of 14,164.53 hit on October 9, 2007.

The S&P 500 and the Nasdaq also closed in positive territory. The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, slid near 12.

(Read More: Cramer: This Is a 'Great Gatsby' Market)

Most key S&P sectors ended higher, led by consumer staples and energy.

The Dow and the S&P 500 have both rallied 7 percent since the beginning of the year. The S&P has climbed for the past seven-straight weeks, though most of the gains have been small.

"Many investors are now wondering if this advance is tired and in need of a rest, arguing that a digestion (0 percent to 5 percent decline) would be refreshing, a pullback (5 percent to 10 percent) would be healthy, and a correction (10 percent to 20 percent) would be scary, but would reset the clock quite nicely," said Sam Stovall, chief equity strategist at S&P Capital IQ.

(Read More:Pisani: Can the Rally Continue?)

Google climbed to top $800 a share for the first time. The search-engine giant's stock has now gained by nearly 35 percent since Larry Page succeeded Eric Schmidt as CEO in April 2011. The search-engine giant crossed the $700 level in October 2007.

Other major companies hit new all-time highs Tuesday, including Johnson & Johnson, Procter & Gamble, Walt Disney and 3M.

Interestingly, while Google soared nearly 20 percent in the last three months, Apple lost almost 19 percent in the same period, creating a near-symmetric divergence between the two tech giants.

Separately, Apple said it was attacked by hackers who infected a small number of Macs, though there was no evidence that any data was taken from the tech giant. Apple said it is releasing an updated software tool to protect customers from Java-related malware Last week, social-networking giant Facebook confirmed that it was targeted by the same hackers last month.

On the economic front, U.S. home builder confidence slipped to 46 in February from 47 in the previous month amid uncertainties about job growth and rising cost for building materials, according to the NAHB/Wells Fargo Housing Market index. Economists surveyed by Reuters had expected a reading of 48. A reading above 50 indicates favorable conditions for builders, a level not seen since April 2006.

Homebuilders including Toll Brothers, Ryland and KB Home turned lower following the report.

Office Depot soared amid reports that the office supply retailer is in advanced talks to merge with smaller rival OfficeMax and a deal could come as early as this week. And Credit Suisse raised its price target on Office Depot to $6.50 a share from $3.75 a share. Meanwhile, Staples jumped nearly 15 percent to lead the S&P 500 gainers.

(Read More: We Know M&A's Back—But Where's It Going Next?)

The deal talks come as M&A have picked up. Just last week, US Airways announced a merger with American Airlines parent AMR. Warren Buffett's Berkshire Hathaway said it was acquiring ketchup maker Heinz and Comcast announced a $16.7 billion deal for the remaining 49 percent of NBCUniversal still owned by General Electric.

So far, more than $158 billion in deals have been announced in 2013, pointing to healthy valuations and positive bets on the economic outlook.

Among earnings, Medtronic posted higher earnings as sales gained, but shares declined.

Express Scripts rallied after the pharmacy benefit manager topped earnings and revenue estimates, thanks to increased demand for generic drugs as well as the firm's acquisition of Medco Health Solutions last year.

Investors will focus on earnings from Dell after the closing bell. Analysts surveyed by Reuters expect the tech company to post earnings of 39 cents a share on revenue of $14.12 billion.

"Dell is in a really tough spot," Dan Niles, chief investment officer at AlphaOne Capital, told CNBC. "They are in the PC industry and that's a huge weight. Last year was the first year PC units declined since if you go back to when the tech bubble burst. Tablets are coming in, they are taking out the low end, smartphones are coming in as well."

Founder and Chief Executive Michael Dell remains in talks to secure the firm's $24.4 billion buyout.

Herbalife and Marriott International are also among companies scheduled to post quarterly results after the closing bell.

Best Buy jumped after Barclays upgraded the consumer electronics retailer's rating to "overweight" from "equal weight," citing stabilizing sales and cost cuts, as well as founder Richard Schulze's ongoing interest in a buyout. Stifel Nicolaus also lifted its rating on the company to "buy" from "hold."

Meanwhile, Humana slumped to lead the S&P 500 laggards after the health insurance company said the government's proposed 2014 payment rates for Medicare Advantage participants were lower than expected and would hurt its profit outlook. Other health insurers including Cigna, UnitedHealth and Aetna also traded in the red.

European shares ended higher after German investor sentiment in February jumped to its highest level in nearly three years, signaling that Europe's largest economy could be recovering.

(Read More: Currency Trading Is Interesting Again)

—By CNBC's JeeYeon Park (Follow JeeYeon on Twitter:@JeeYeonParkCNBC)