“While there is more to be done to help Americans save more effectively for their retirement, these are positive trends that show we are clearly moving in the right direction,” Jean Young, senior analyst at the Vanguard Center for Retirement Research, said in a news release issued by the company.

The rebound comes just as the wave of baby boomers reaching retirement age is beginning to crest. The most recent census showed the ranks of seniors at historic levels: More than 40 million people were age 65 or older, making up 13 percent of the population.

Some economists have argued that the rapid rise in stocks could encourage some older Americans who delayed retirement during the downturn to finally leave their jobs.

Retirement accounts have become an increasingly important part of workers’ long-term financial security as fewer companies provide pensions and other defined benefits. Although retirement accounts give workers more control over their savings, the recent financial crisis also highlighted the enormous risks to which their nest eggs are exposed.

Since then, stock markets have skyrocketed as the economic picture has improved and the Federal Reserve has sponsored an unprecedented stimulus effort. The Dow Jones industrial average gained almost 27 percent last year to reach new nominal highs. According to Fidelity, market gains fueled more than three-quarters of the increase in 401(k) balances.

Contributions from employees or their companies accounted for the remainder of the gains. Many businesses match a percentage of the savings that workers put into their retirement accounts. However, a growing number of companies are reducing the match or changing the schedule of contributions.

An analysis by the Federal Reserve Bank of Philadelphia found that the percentage of people who said they were leaving the workforce to retire began to rise in 2010, after the recession ended. But the number picked up in 2012 as the stock market began to improve. Since then, retirement has been the most important factor in people leaving the labor force, the research found.

“A plausible conjecture is that the 2008 financial crisis and associated loss of wealth might have had the effect of delaying their retirement age, while the subsequent recovery of financial wealth has allowed more of them to retire in the past few years,” wrote Shigeru Fujita, a senior economist at the bank.

While that hypothesis is still being debated, there is widespread agreement that the aging of America is one of the main factors in the country’s shrinking workforce. According to research by the Federal Reserve Bank of Atlanta, nearly 13 million people left the labor force from the start of the recession through the end of last year. More than 40 percent of them — about 5.5 million people — quit working to retire, making retirement the most common reason for leaving.

Analysis by the Center for Retirement Research at Boston College showed that Wall Street’s gains in 2013 only modestly improved Americans’ retirement prospects. The center looked at an index of financial security for working-age households. It found that 53 percent risked being unable to maintain their standard of living after retirement in 2010. That number dipped only slightly in 2013, despite the bull market.

Among the reasons the report cited for the modest decline was the distribution of stock market gains. They were enjoyed mainly by high-income households, which held 17 percent of their wealth in stocks. By contrast, only 2 percent of poor families’ wealth was in equities.

The more important factor in retirement security is housing prices, according to the center. While real estate values have improved since the recession, they have not made the big jump seen in the stock markets.

“The only way out of this box is for people to save more and/or work longer,” the report concludes.

Ylan Q. Mui is a financial reporter at The Washington Post covering the Federal Reserve and the economy.

Comments our editors find particularly useful or relevant are displayed in Top Comments, as are comments by users with these badges: . Replies to those posts appear here, as well as posts by staff writers.

To pause and restart automatic updates, click "Live" or "Paused". If paused, you'll be notified of the number of additional comments that have come in.

Comments our editors find particularly useful or relevant are displayed in Top Comments, as are comments by users with these badges: . Replies to those posts appear here, as well as posts by staff writers.