By Heather Gillers and Peter Santilli | Photographs by Miranda Harple for The Wall Street Journal

States have avoided a Great Depression-scale cash crisis.

Despite the pandemic's crushing toll on the economy, total state tax revenues were roughly flat in 2020 from the year before, according to the Urban Institute, a Washington, D.C., think tank.

Last spring, stores shut down to contain the spread of Covid-19 and unemployment skyrocketed. People spent less money on everything from shoes to restaurants to salons. Sales tax collections fell billions of dollars short of forecasts.

But widespread federal intervention buoyed households, businesses and financial markets and helped avert analysts' doomsday projections for state revenues. The stable employment environment for the country's most affluent workers also brought in stronger than expected tax revenue.

Analysts still expect states to confront budget gaps as the pandemic enters its second year, but they are projecting smaller shortfalls partially filled in with federal aid. A Democrat-led Congress is now debating another massive round of federal aid, amid objections from Republicans.

The cash that would help contain the crisis began trickling in around the country in early spring with congressional approval of a $2 trillion stimulus package. The federal government sent checks for $1,200 to many households, and Americans spent about 29% of those checks, according to the Federal Reserve Bank of New York, further boosting state sales tax revenues.

As state bookkeepers in Harrisburg, Pennsylvania's capital, recorded hundreds of millions of dollars in sales-tax shortfalls, customers were already flocking to places like Cole's Bicycles, Inc., about 20 miles down the road in the 20,000-person town of Carlisle.

By July, sales tax collections in Pennsylvania were nearly double what they had been in May.

The March 2020 stimulus package boosted state income taxes alongside sales taxes by increasing weekly unemployment checks and giving loans to businesses to keep workers on their payrolls. Federal lawmakers also sent $150 billion directly to states and local governments to address Covid-19-related costs.

The Colonial Heights, Va., public schools received more than $3 million in federal dollars to cover health and safety supplies and buy Chromebooks and Wi-Fi hot spots for students learning from home.

The school installed a new HVAC system to improve air circulation in school buildings.

"I don't know that we could have paid for $300,000 worth of HVAC without the stimulus, that's for sure," said Superintendent William Sroufe.

"I mean we were three, four hundred thousand dollars probably in PPE materials alone."

The district also used some of the Covid aid to help cover hazard pay for teachers, custodians and other staff.

As money from Congress flowed to the bank accounts of consumers and businesses, the Federal Reserve stepped in during March and April to halt a historic market slide.

Stocks rallied, boosting the incomes of high earners and helping protect well-paying jobs, many of which could easily be performed from home. These jobs further shored up state income tax revenues, particularly in states like California, where 78% of state personal income-tax revenues come from the top 10% of income tax returns.

The biggest U.S. state is predicting a $26 billion surplus for budget year 2020-21, according to an estimate by the California Legislative Analyst's Office. Layoffs remained concentrated among low earners.

Personal income tax collections caught up to and then surpassed pre-pandemic projections.

Meanwhile, the stock rally and a wave of initial public offerings contributed to high expectations for both capital-gains and income taxes. The revenue bounceback in the nation's largest state helped propel total 2020 state tax revenue collections to nearly 2019 levels.

The market gains also shored up retirement funds, helping rein in states' annual pension payments.

The Fed's intervention also restored crucial access to credit for state and local governments just as their revenues were crashing.

In March 2020, the municipal market ground to an unprecedented halt as investors spooked by the pandemic's impact on state and local governments pulled out at rock bottom prices. Even gold-plated borrowers had trouble finding buyers. But prices bounced back quickly after an unprecedented pledge to buy up municipal debt, and borrowing grew cheaper than it was in 2019.

Public officials refinanced outstanding bonds and used credit to pay the bills. At least a quarter of state and local government bond issues of $100 million or more between August and December were aimed at filling budget gaps, according to a study from The Pew Charitable Trusts and Municipal Market Analytics. The issuance included about $4 billion in coronavirus emergency bonds from the state of New Jersey.

The total cash shortfall states face for budget years 2020-22 as a result of the pandemic now looks to be about $148 billion, according to forecasters at Moody's Analytics. In September the group, the economic analysis arm of Moody's Corp., had estimated that gap could reach $434 billion, which would have amounted to the worst cash crisis since the Great Depression.

States' surprising resilience is a hot topic in Congress where the Senate on Saturday passed a $1.9 trillion aid package and sent it back to the House of Representatives. The package includes funding for vaccine distribution and a third round of stimulus checks amounting to $1,400 for many Americans. It would also send $350 billion more in aid to state and local governments, a move Republicans have criticized as wasteful and unnecessary.

As revenue dropped and spending to combat the coronavirus and cushion the economy surged, the federal budget deficit roughly tripled in the budget year ending Sept. 30. The deficit reached $3.1 trillion according to the Treasury Department. That is 16.1% of the country's total economic output, the most since 1945, when the U.S. was financing massive military operations to help end World War II.

States could also face additional longer-term cost pressures. With unemployment still well above pre-pandemic levels, some analysts caution that states could see an increased demand for services from low-wage workers crushed by Covid. Some local governments will likely turn to states for help as they struggle to balance their budgets. And borrowing to get through the early cash crisis will eventually need to be paid back.

The revenue picture is also unclear. The boost to income-tax collections resulting from the stock market rally may not repeat in 2021. States, though in far better financial shape than predicted at the start of the pandemic, are still not confident enough to hire back all the workers they shed in 2020.

State government employment is at its lowest level in more than 15 years, including during and after the 2008 recession, according to the Bureau of Labor Statistics. But more federal help may be on the way with Democrats now controlling both houses of Congress and the presidency.

Thad Chambers contributed to this article.

Write to Heather Gillers at heather.gillers@wsj.com and Peter Santilli at peter.santilli@wsj.com

(END) Dow Jones Newswires

03-10-21 0544ET