Investors capped a year of solid gains on Wall Street Friday in a selling mood, sending the major U.S. stock indexes modestly lower on the final trading day of 2016.

Trading was subdued ahead of the New Year’s Day holiday.

Despite riding out the last week of the year with losses, halting the Dow Jones industrial average’s momentum as it neared the 20,000 mark, 2016 delivered a much better finish for stock investors than most would have anticipated.

All told, the Dow ended the year with a 13.4 percent gain, while the Nasdaq composite gained 7.5 percent.

The Standard & Poor’s 500 index, the broadest measure of the stock market, gained 9.5 percent after an essentially flat finish in 2015. Including dividends, the total return was 12.5 percent as of Thursday’s close.

Small-company stocks fared the best, especially since the election. The Russell 2000 index closed out 2016 with a gain of 19.5 percent.

“This was not just a market that did well, it did extremely well,” said Quincy Krosby, market strategist at Prudential Financial.

advertisement | advertise on newsday

On Friday, the Dow slid 57.18 points, or 0.3 percent, to 19,762.60. The S&P 500 index fell 10.43 points, or 0.5 percent, to 2,238.83. The Nasdaq composite gave up 48.97 points, or 0.9 percent, to 5,383.12.