BOSTON (AP) — Workers continued to stash more money in their 401(k) plans in the second quarter, but the stock market's modest decline left them slightly further behind in reaching their savings goals.

Fidelity Investments, the nation's largest 401(k) administrator, said on Thursday that the average balance among its nearly 12 million accountholders was $72,800 at the end of June. That's 2.4 percent less than at the end of March, and largely unchanged from last year's second-quarter average.

It didn't help that the Standard & Poor's 500 stock index fell 2.8 percent during this year's second quarter. Investors worried about the European debt crisis and slow economic growth at home.

Workers' 401(k)s are typically invested in bonds along with stocks to help reduce volatility. A broad U.S. bond market index rose nearly 2.1 percent in the second quarter, helping to offset some of the stock market's decline.

Damage to account balances also was reduced because workers set aside more from their paychecks, and employers increased 401(k) matching contributions.

The average employee contribution in the latest quarter was $1,660, up $30 from the same quarter a year ago. Their employers contributed an average $950, also up $30.

Account balances have shown healthy growth through the first half of the year due to higher contributions and strong first-quarter stock market performance. The S&P rallied nearly 13 percent in the first quarter, before surrendering a portion of that gain in the second quarter.

"The continuous contributions are helping to sustain people through these fluctuating markets," says Beth McHugh, vice president of market insights at Boston-based Fidelity.

Investment earnings and contributions can grow tax-free in an employer-sponsored 401(k) account, which is a key reason why they're a popular way to save for retirement.

The average employee contribution in Fidelity-administered 401(k) plans has remained steady at around 8 percent of annual pay for the past three years. In the latest quarter, about twice as many participants increased their contributions than decreased them.

That's consistent with the trend since the financial crisis. Balances have grown a cumulative 58 percent since early 2009, when the stock market meltdown reduced the average balance to $46,200.

Yet workers who have stayed in the market long term have found it difficult to rely solely on investment gains to build up 401(k) savings. Stocks remain about 12 percent below their historic peak in October 2007.

Over the past 10 years, about two-thirds of annual increases in account balances have been due to workers' added contributions and company matches, with one-third the result of investment returns.