On Tuesday the Standard & Poor's 500 rose 7.29 points, or 0.4 percent, to 1,848.36. The index ended 2013 up 29.6 percent. With dividends included, the total return was 31.9 percent.
The Dow Jones industrial average rose 72.37 points, or 0.4 percent, to 16,576.66. The blue chips ended the year up 26.5 percent.
Lastly, the Nasdaq composite rose 22.39 points, or 0.5 percent, to close out 2013 at 4,176.59. The Nasdaq did far better than the Dow and S&P, rising 38.3 percent for the year.
While stocks clawed higher for most of 2013, the rally accelerated into the end of the year. The Federal Reserve's announcement on Dec. 18 that it would start paring back, or "tapering," its economic stimulus pushed stocks further into record territory.
"Since the Fed announced it was tapering its stimulus program two weeks ago, investors that were underinvested in stocks have pulled out of gold and bonds and moved it into stocks," said J.J. Kinahan, chief strategist with TD Ameritrade. "It's been a quiet rally."
All 10 sectors of the S&P 500 ended the year higher, but the year's biggest gainers were companies most exposed to the U.S. economic recovery. Consumer discretionary stocks in the S&P 500 rose 40 percent this year. Close behind were industrial stocks with a gain of 37 percent.
As it has been for the last two weeks of the year, trading volume was very low Tuesday. Roughly 2.3 billion shares were traded on the New York Stock Exchange, about 40 percent below average. Most investors closed their books before the week of Christmas.
2013's rally took many investors by surprise.
Any number of things could have derailed the market's rally: The U.S. government shutdown, the possibility of a default, the threat of military action in Syria, budget cuts and new worries about European government debt. Instead, the market just kept on going.
Skittish investors who jumped out of stocks this year not only lost out, but were punished for it.
Bond investors lost money this year, according to Barclays Capital U.S. Aggregate Bond Index, a broad measure of the debt market. The index fell 2 percent this year, the first decline since 1999.
If bond investors had a disappointing year, gold investors got slammed. Gold lost 28 percent of its value in 2013, its worst year since 1981.
With the U.S. economy improving and stocks performing so well, gold is likely to remain under pressure, Kinahan said.