NEW YORK — Wall Street closed out an epic year with the stock market's best performance since 1995, fattening the retirement accounts for a generation of Americans crushed by the financial crisis just five years ago.

The 27% gain in the Dow Jones industrial average enabled investors to recoup the last of the losses suffered during the Great Recession, when the value of America's blue-chip stocks was slashed in half. And analysts are predicting that stocks will continue their upward march in 2014, though perhaps not at such a breakneck pace.

Record after record was smashed for equities last year, generating a sense of jubilation on the floor of the New York Stock Exchange. The world's most closely watched index shot past 14,000 in February, 15,000 in May, 16,000 in November, and on Tuesday closed above 16,500 for its 52nd all-time high of the year.

The milestones caused Americans, still wary of the market since the 2008 crisis, to increasingly tune in to see how their 401(k) and other investment accounts were doing. Vanguard Group, the world's biggest mutual fund manager, saw eager clients log into their online accounts roughly 300 million times in 2013, up nearly 30% from the previous year.

"It feels really good," said Mark Kearney, 46, a police officer in rural Virginia who invested an additional $8,000 in stocks as the rally advanced. "I was pleasantly surprised in a way, but I knew the way the market is, it was bound to have a year like this."

Besides the Dow's finish at 16,576.66, broader market indexes were also red hot. The Standard & Poor's 500 index, seen as the best barometer for the market, soared 30% to 1,848.36. Big gains made by technology companies powered the Nasdaq composite up 38% to 4,176.59.

The rapid rise surprised even the most bullish prognosticators on Wall Street.

Last year's rally withstood an onslaught of potential spoilers: a terrorist attack in Boston, paralyzing Washington brinkmanship, political turmoil in the Middle East, and worries over the U.S. Federal Reserve yanking away its punch bowl of easy money.

"We've had a government shutdown and debt-ceiling debate that brought us to the edge of default, and the stock market didn't care," said Jack Ablin, chief investment officer at BMO Private Bank. "For the most part, Wall Street shrugged it off."

Indeed, the total value of U.S. shares ballooned by some $5.4 trillion, as measured by the Wilshire 5000 Total Market Index. Gains were seen across the board, in most every line of commerce, as individual investors felt comfortable enough to dive back into stocks.

This enabled average investors, who were left behind by an economic recovery that boosted corporate coffers more than workers' paychecks, to finally get their own windfall. Last year was the first since 2007 that investors shoveled more into stock mutual funds than they withdrew.

But not everyone benefited.

Although the rising tide lifted many portfolios in the middle class, only half of all Americans own stocks, including 401(k) and other retirement accounts.

Unemployment in the U.S. remains high, leaving many people unable to invest. There are also many who have sworn off stocks after being hobbled by the financial crisis, which led to the biggest market rout since the Great Depression.

"I don't trust this huge rally," said Danny Upshaw, a 35-year-old graduate student in Monroe, La., who shifted about half of his investments into cash amid the run-up. "The economy, from what I can tell, is not really doing that great right now, but the stock market is going gangbusters."

Stocks were partly fueled by the Fed's monumental stimulus program, known as quantitative easing. The easy-money policies kept short-term interest rates low and sent investors clamoring for better returns in the stock market.

Investors even shrugged off the central bank's announcement last month that it would begin gradually scaling back, or "tapering," the stimulus program. Although long-term interest rates jumped in 2013 in anticipation of the Fed's pullback, the rally in stocks only accelerated as investors viewed the move as a sign that the economy was improving.

All 10 sectors of the S&P 500 finished the year higher. Among the biggest gainers, consumer discretionary stocks were up 41% in a sign that Americans are spending again, and industrial stocks posted a 38% gain.

Some of the big blue-chip movers this year were computer maker Hewlett-Packard Co. (up 96%) and travel discount site Priceline.com Inc. (up 87%). The only loser in the 30-member Dow was IBM Corp. (down 2%).

Investor enthusiasm also made 2013 a banner year for companies looking to raise equity from the public for the first time. Micro-blogging juggernaut Twitter Inc. raised nearly $2 billion with its initial public offering in early November, even though the company has yet to turn a profit. Twitter's stock closed at $63.65, up 42% since its debut.