(AP) -- 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.
Technology and consumer-focused stocks led the broad slide, while real estate companies and banks eked out small gains. As it had been for much of the week, 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.
The stock market weathered repeated slumps in 2016, including the worst start to any year for stocks, the second correction for the market in five months and plummeting oil prices. A steadily improving U.S. economy and job market, as well as more stable oil prices and better company earnings growth helped turn the market around. More recently, investor optimism following the Republican election sweep in November kicked off a rally that sent the market to new heights.
Some of that enthusiasm evaporated in the final week of the year, as traders seized on the quiet period between the Christmas and New Year's holidays to do some selling to lock in profits.
"So many times we look for a rally at the end of the year, particularly between Christmas and New Year's," said J.J. Kinahan, TD Ameritrade's chief strategist. "But with the incredible up move we've had since the election, people are either hesitant to buy things heading into the new year or are taking a little bit of profit."
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.
The Russell 2000 lost 6.05 points, or 0.4 percent, to 1,357.13.
Bond prices rose. The yield on the 10-year Treasury note fell to 2.44 percent from 2.48 percent late Thursday.
Global stocks mostly rose on the year's last day of trading.
Britain's index rallied to hit another all-time high. The FTSE 100, which was trading for only a half day, rose 0.3 percent. That left the index 14.4 percent higher over 2016.
Elsewhere in Europe, Germany's DAX rose 0.3 percent, while France's CAC 40 gained 0.5 percent. Earlier in Asia, Japan's Nikkei 225 fell 0.2 percent, while Hong Kong's Hang Seng index rose 1 percent.
Benchmark U.S. crude fell 5 cents to close at $53.72 a barrel in New York. That translates into a 45 percent gain for the year. Brent crude, used to price international oils, slipped 3 cents to close at $56.82 a barrel in London.
In other energy trading, wholesale gasoline dropped 2 cents to $1.67 a gallon and heating oil held steady at $1.70 a gallon. Natural gas futures fell 7.8 cents, or 2.1 percent, to $3.72 per 1,000 cubic feet.
The price of gold fell $6.40 to $1,151.70 an ounce. Silver slid 23 cents to $15.99 an ounce. Copper rose 2 cents to $2.51 a pound.
In currency trading, the dollar strengthened to 116.78 yen from 116.65 yen late Thursday. The euro rose to $1.0531 from $1.0485.