State governments have socked away more than $72 billion in reserve funds, a new report shows, as governors, legislators and budget officials prepare for an economic downturn.

The big balances are in part a recognition that states were not prepared for the Great Recession in 2008. Back then, states had stockpiled $33 billion, less than half what they have on hand now. Several states did not even have rainy day funds.

“In the years following the Great Recession, we’ve seen a number of actions taken at the state level to reform deposit rules, set policies and put policies and laws in place to ensure that their rainy day fund is replenished and strengthened during good economic times, so that they are prepared for the next downturn when it does hit,” said Kathryn Vesey White, director of budget process studies at the National Association of State Budget Officers (NASBO), who compiled the report.

Several straight years of unexpectedly strong tax revenues have allowed states to save that money, experts said. Forty-six states reported higher than expected revenue in the last year, the highest levels of overperformance in more than a decade.

Most states that reaped the benefit of a booming economy have acknowledged that the good times won’t last forever, White said. Those states often segregate one-time revenue from revenues they expect to continue and use that money for one-time projects, rather than ongoing commitments they would have to cut in a downturn.

“The looming threat of whenever the next recession is going to hit is still very much on state budget officials’s minds. They’re trying to be reserved about new ongoing spending commitments,” White said.

Legislators said they are mindful of the economic cycle. Forty-nine states are required by law or their constitutions to balance the budget every year, an added incentive to stockpile cash to avoid painful cuts in the future.

“If you have uncertainty in the economy, you have to be prepared for that,” said Pat Grassley (R), the incoming Speaker of the Iowa state House. “Iowans expect us to have a balanced budget. We pass a balanced budget every year.”

The size of reserve funds varies widely by state. California, hit hard by the recession because of its reliance on capital gains taxes, has spent a decade stockpiling more than $20 billion as of fiscal 2019.

Kansas, which only recently created a rainy day fund, has nothing in its savings account. Illinois, hit by a pension crisis that remains unresolved, has only $4 million in reserve.

Nineteen states have at least a billion dollars in their reserve funds, ranging from California and Texas to tiny states like Alaska and Wyoming, which collect big severance taxes from oil and gas producers.

The end-of-year budget report shows states in strong fiscal position virtually across the board. No states had to make midyear budget revisions in fiscal 2019, a sign that tax revenues met or exceeded expectations. General fund spending increased by 5.8 percent, the highest level since 2007, NASBO reported.

States budgeted an additional $39 billion in spending this year, much of it focused on K-12 and higher education. More than a dozen states budgeted tens of millions of dollars for teacher pay raises this year after loud protests in states like West Virginia, Kentucky and Oklahoma last year, accounting for a big chunk of that new spending.

But there are early signs that the boom is easing, if not reversing itself. Revenue collections are expected to top $903 billion, up 2.6 percent over the year before — a level that reflects slowing growth.

“This fiscal year that we’re in now, states are not expecting to see the same level of revenue growth that they’ve seen the last couple of years. The economy has been showing some signs of slowing,” White said.