CHERRY HILL, N.J. — A public employee pension crisis for state governments has deepened to a record level even after nearly nine years of economic recovery for the nation, according to a study released Thursday, leaving many states especially vulnerable if the economy hits a downturn.

The massive unfunded pension liabilities are becoming a real problem not just for public-sector retirees and workers concerned about their future but for everyone else, too. As states try to prop up their pension systems, it means less money is available for core government services such as education, public safety and parks.

The annual report from the Pew Charitable Trusts finds public worker pension funds with heavy state government involvement owed retirees and current workers $4 trillion as of 2016. They had about $2.6 trillion in assets, creating a gap of about one-third, or a record $1.4 trillion.

While the study looks only at pension funds with major state-government involvement, systems run by cities, counties, school districts and other local entities have had similar problems. Just this week, Harvey, a city with a history of underpaying its pension obligations, announced deep layoffs in its police and fire departments. Officials blamed their rising pension obligations.

Larger cities and school districts across the country also have had service cuts or freezes over the years to pay for rising costs for their retirees.

RELATED ARTICLES

• Illinois Supreme Court strikes down Chicago pension rescue plan

• Cash balance better, pension crisis worse, Chicago audit shows

• THE WATCHDOGS: Generous pension benefits only one part of state, city financial crisis

Pew says that pension funds were well-funded until about 2000. Around that time, many states increased pension benefits without a way to pay for them. In some states, such as California and Illinois, courts usually find that the government must honor those commitments.

Also in the early 2000s, the tech stock bubble burst, spiraling investment returns downward. Some states, such as New Jersey, made things worse by skimping on their contributions.

Many pension funds had not recovered from the dot-com bust by the time the Great Recession hit less than a decade later. And many haven’t recovered from that, either.

“When the next downturn comes, there will be additional pressures,” David Draine, a senior officer at Pew, told The Associated Press.

Colorado, Connecticut, Illinois, Kentucky and New Jersey had less than half the assets they needed to meet their obligations, according to the report.

Just four states — New York, South Carolina, Tennessee and Wisconsin — had at least 90 percent funding. Draine said those states and some others that have repaired pension shortfalls since the Great Recession will be in better shape the next time the economy slides.

The Pew report found that lackluster investment returns in 2016 explained most of why the condition of pensions declined from the previous year. Pension administrators were counting on median returns of 7.5 percent that year. Instead, they made just 1 percent.

But the study says that even if the investments had met expectations, the overall position of pension funds still would have declined because state governments were not contributing enough. Only Kansas contributed more to its pension system in 2016 than it paid out, Pew found.

In New Jersey, actuaries say it will take around $6 billion a year in contributions from the state to shore up its pension system. It’s taken years to get to less than half that amount in the current budget. Maintaining that progress makes it difficult to pay for other priorities, such as boosting school funding.

The study finds that states increasingly rely on investment returns in an attempt to stabilize their finances, which makes them more vulnerable to market fluctuations.

Because of a strong market last year, next year’s report, which will assess the state of pensions as of 2017, is expected to look better. But market slides so far this year have not been encouraging, Draine said.