Just a year ago, the financial future looked bleak for state governments as governors and lawmakers scrambled to cut spending amid the coronavirus recession that was projected to pummel revenue.

They laid off state workers, threatened big cuts to schools and warned about canceling or scaling back building projects, among other steps.

Today, many of those same states are flush with cash, and lawmakers are passing budgets with record spending. Money is pouring into schools, social programs and infrastructure. At the same time, many states are socking away billions of dollars in savings.

"It’s definitely safe to say that states are in a much better fiscal situation than they anticipated," said Erica MacKellar, a fiscal analyst with the National Conference of State Legislatures.

BIDEN USES WEAKER-THAN-EXPECTED MAY JOBS REPORT TOUT ECONOMIC AGENDA

Spending plans for the budget year that begins July 1 are up 10% or more in states spanning from Florida and Maryland to Colorado, Utah and Washington.

In Oklahoma, pandemic uncertainties last year prompted lawmakers to trim $1.3 billion from their anticipated general revenue. That resulted in across-the-board cuts for public education and most state services.

This year, the new budget is up nearly 18%. That includes money to reduce class sizes in kindergarten and first grade, funding for a new children's behavioral health center and new incentives for businesses to make movies in Oklahoma. The Republican-led Legislature even set aside money to cut individual and corporate income tax rates and expand tax credits for a school choice program.

"Last year: shaky foundation. This year: solid foundation," said Republican state Sen. Roger Thompson, chairman of the chamber's budget-writing committee.

Many states experienced a similar turnaround. Fiscal analysts cite a variety of reasons.

The federal government poured billions of dollars into state coffers through a series of pandemic relief packages. Federal aid also sent billions more to U.S. households and businesses that, in turn, pumped money into the economy.

State finances also fared better than feared. Consumer spending rebounded to shore up sales tax revenue, and state income taxes were bolstered by a strong stock market and high-wage earners who kept working remotely while others were laid off.

The result is that states now face "a very promising fiscal and economic outlook over the next couple of years," said Justin Theal, a state fiscal research officer at The Pew Charitable Trusts.

Finance investment stock market chart graph currency exchange global business fintech ++The World map texture derived from public domain NASA: http://visibleearth.nasa.gov. Traced in Illustrator. File created on November 29 2018++ (Getty Images / iStock)

REP. KEVIN BRADY LAYS IN MAY JOBS REPORT, SAYS BIDEN'S POLICIES HOLDING AMERICA BACK

A recent Pew report found that after an initial sharp plunge in tax revenue, 29 states recovered to take in as much or more during the peak pandemic period of March 2020 through February 2021 than they did during the same 12 months before the pandemic began.

Idaho, Utah, Colorado and South Carolina posted some of the biggest revenue gains along with South Dakota, which was one of the few states never to shut down. The Pew report also noted modest revenue gains for some states that imposed more aggressive coronavirus precautions on their economy, including California, Massachusetts and New York.

The $212 billion budget enacted earlier this year in New York is up almost 10% over the previous one. Federal COVID-19 relief provided the bulk of that growth. But state spending alone still is up by 3.8% in the new budget, according to Democratic Gov. Andrew Cuomo's administration.

New York's bigger budget includes a mixture of ongoing and one-time spending, including a $1.4 billion boost in basic aid for schools and a $1.3 billion plan to overhaul Penn Station.

Florida's record $101.5 billion budget is up roughly 11%, with bonuses for teachers, police and firefighters, and new construction projects at schools and colleges. Lawmakers decided they had money to spare, expanding sales tax breaks for school and hurricane supplies and creating a new tax-free week to buy museum and concert tickets and recreational gear for camping, fishing and surfing.

Florida is among several states that amplified their 2021-2022 budgets with at least part of their share of a $195 billion state aid package from the recent American Rescue Plan Act signed by President Joe Biden.

CLICK HERE TO READ MORE ON FOX BUSINESS

Shortly after that plan passed, Moody's Investors Service upgraded the outlook for states from negative to stable, citing stronger state finances and continued federal aid. It said the new federal aid equaled nearly 16% of states' own revenue for the 2019 fiscal year.

Some states, such as Colorado, are waiting until later to decide how to use the latest COVID-19 relief funds because they have until the end of 2024 to spend it.

Even without the latest federal aid, Colorado's budget for the fiscal year starting July 1 is up more than 12% from the previous one, which had been pared back because of pandemic concerns.

Sen. Bob Rankin, a Republican member of the Legislature's Joint Budget Committee, said he is concerned about how that additional $3.8 billion of federal aid will be spent.

"I’m afraid that we are spending money and making commitments that we will not be able to sustain once that one-time federal money goes away," Rankin said.

In many states, lawmakers are devoting federal COVID-19 relief money to one-time purposes, such as additional aid to workers, expanded access to high-speed internet or replenishing depleted unemployment trust funds.

Missouri is among the states that has yet to decide what to do with the latest federal aid. The general revenue portion of its budget has rebounded from a fiscal 2021 cut to exceed pre-pandemic levels. And Missouri is on pace to shatter a record set in 1998 for its largest end-of-year cash balance.

"Revenues have performed much, much better than I would have ever anticipated during a pandemic," said state Budget Director Dan Haug.

FILE - In this Wednesday, March 10, 2021 file photo, Colorado state Sen. Bob Rankin speaks during a news conference outside the governor's mansion in Denver. Rankin, a Republican member of the Legislature's Joint Budget Committee, said he is concerne

GET FOX BUSINESS ON THE GO BY CLICKING HERE

He said he thinks Missouri would have been able to weather the pandemic without this year's Biden relief package.

Lawmakers in Maryland used words like "stunning" and "unique" to describe how federal aid helped reshape their budget situation. The state's record $52.4 billion budget for its new fiscal year provides bonuses to state workers, boosts payments to the poor, builds parks and playgrounds in every county, and still sets aside about $2 billion for savings.

"After spending almost the entire part of last year in sleepless nights trying to figure out what in the world we were going to do, to find yourselves in that position was pretty amazing," said Democratic state Sen. Guy Guzzone, chairman of the Senate Budget and Taxation Committee.