By Akane Otani and Mike Bird

U.S. stocks climbed in a volatile session Tuesday, their first trading day of 2017.

The day began with a surge in shares of financial companies, which helped the Dow Jones Industrial Average jump more than 175 points shortly after the opening bell. The gains brought the index within 100 points of the never-before-reached 20000 milestone. But as bank shares retreated slightly, the Dow industrials pared their gains.

The blue-chip index finished up 119.16 points, or 0.6%, at 19881.76, snapping a three-session losing streak. The S&P 500 added 19 points, or 0.8%, to 2257.83, boosted by shares of telecom and health-care companies, and the Nasdaq Composite rose 45.97 points, or 0.9%, to 5429.08.

U.S. stocks capped off 2016 with their best performance in years, with the blue-chip index rising by double-digit percentages to log its biggest gain since 2013. Many analysts and investors expect the stock market rally to continue, citing a rebound in corporate earnings, an acceleration of U.S. economic growth, and prospects of tax cuts and fiscal stimulus under the new administration.

"We ended the year with nothing to [damp] the optimism about the 2017 economic outlook," said Kit Juckes, global head of foreign-exchange strategy Société Générale SA.

Still, some investors caution that stock valuations appear stretched, and that the market's year-end run may have been overdone. Headwinds like the strengthening dollar and the potential for protectionist policies -- both of which could hurt multinational companies -- could offset the tailwinds of a growing economy and improving corporate earnings.

"We're in the modestly positive camp," said Jason Pride, director of investment strategy for Glenmede. "We were surprised by the market's strength going into the end of the year, which makes our mindset a bit more cautious heading into 2017."

On Tuesday, health-care shares were among the best performers in the S&P 500, rising 1.4%. Amgen, Gilead Sciences and Centene each rose more than 2%.

Telecom and tech lifted the index as well, rising 1.9% and 0.9%, respectively.

Meanwhile, it was a bumpy day of trading for General Motors, which on Tuesday became the latest corporation to come under attack by President-elect Donald Trump.

Early Tuesday, Mr. Trump criticized the car maker on Twitter for sending some of its Chevrolet Cruze cars produced in Mexico to U.S. dealerships. Shares initially slid inpremarket trading, but recovered to trade up 31 cents, or 0.9%, at $35.15.

While major indexes gained, developed government bonds continued their slide, with the yield on the U.S. 10-year Treasury note climbing to 2.450% Tuesday from 2.446% previously, according to Tradeweb. Yields rise as bond prices fall.

Expectations of inflation and faster economic growth have pressured long-term government bonds, as they erode the value of their fixed returns.

Elsewhere, banks and oil-and-gas companies led the Stoxx Europe 600 index 0.7% higher and into bull-market territory, marking a gain of 20% from its previous low. London's FTSE 100 rose 0.5%, notching its fourth consecutive record close -- its longest such streak of records since 1999, according to the WSJ Market Data Group.

Shares in Asia closed higher, with Hong Kong's Hang Seng climbing 0.7% and South Korea's Kospi index up 0.9%. Japan's Nikkei 225 was closed for a holiday.Write to Akane Otani at akane.otani@wsj.com and Mike Bird at Mike.Bird@wsj.com

(END) Dow Jones Newswires

January 03, 2017 17:22 ET (22:22 GMT)

Copyright (c) 2017 Dow Jones & Company, Inc.