California Governor Gavin Newsom for years had an enviable problem. His state was awash in cash.

Thanks to the booming tech industry and federal money during the pandemic, California was spending record amounts and still ran a surplus — almost $100 billion last year. That’s when Newsom, a rising star in the Democratic party, sent checks of up to $1,050 to millions of residents. The Los Angeles Times in an editorial declared him the luckiest governor in state history.

Now, following the tech bust and the end of Covid funding, the surplus has been replaced with a $32 billion deficit, forcing lawmakers to trim the state’s lofty climate change program, delay funding and increase internal borrowing.

California is an extreme case of a state that relies heavily on its richest residents for its tax base. But it’s not alone: revenue in 16 other states is down this fiscal year through April, according to the Urban Institute, partly reflecting the volatility in markets and population shifts. Over in Florida and Texas — red states where levies are primarily collected through sales rather than income — it’s a different picture. While the pace of tax collections has slowed, they are among about a dozen states seeing revenue grow 5% or more this year as consumers keep spending.

“You’re starting to see this divergence,” said Emily Mandel, an economist at Moody’s Analytics. “It’s definitely something we’re seeing in the data.”

The differing fortunes are highlighting the growing divisions between the largest Democrat and Republican-led states at a time when they’re competing for businesses and people to relocate, and their leaders are often sniping at each other over policies from immigration to taxation. Texas Governor Greg Abbott is seeking to cut taxes even further with a record $33 billion surplus, while Florida’s 9% bump in revenue so far this year is fueling record spending — giving Governor Ron DeSantis a boost as he fights for the Republican presidential nomination.

Marc Goldwein, senior policy director for the Committee for a Responsible Federal Budget, said the dynamic reflects core differences between states’ tax bases. California and New York saw their populations shrink by about 294,000 residents in the year through July 1, 2022, while Florida and Texas added about 888,000 residents collectively, according to Census Bureau data.

“Part of what’s going on is changes in population — people are moving,” he said. Another aspect is “the reliance on capital gains taxes and other taxes from very high earners who have large fluctuations in their income. So much of those capital gains are in California and New York, which are the center of tech and the center of finance.”

California’s personal income tax collections are its largest revenue source and about half comes from the top 1% of earners. That leaves the budget especially susceptible to financial shocks impacting this small subset of taxpayers.

Other states with high income tax levies are also seeing revenue pressures. In Hawaii, which has a top rate of 11%, the governor cut $1 billion from the budget in order to balance it in June.

Total state tax revenue declined 25% in April, a key month for such collections, according to the most recent data available from the Urban Institute. Thirty-seven states saw revenue fall that month.

Meanwhile, Florida and Texas rely on taxes on sales, which have held up well as Americans keep spending, to the surprise of economists. Those levies have also been bolstered by inflation.

However in a recession, which some economists predict may still hit the US economy, higher unemployment would likely cause consumers to pull back, hurting sales tax revenue. “No state would be shielded from the fiscal impacts of a recession,” said Justin Theal, an officer with the state fiscal health project at Pew Charitable Trusts.

Comptroller Glenn Hegar of Texas, the fastest-growing state economy, said that he expects tax revenue to grow but at a slower pace. Texas is allocating billions of dollars to infrastructure projects and lawmakers are squabbling over how much to cut property taxes. “It just won’t be as vibrant as what we’ve had over the course of the last several years,” he said in an interview.

There are nuances to the data. In California, part of the revenue declines have been driven by the state’s tax filing deadline after a series of natural disasters. But Lucy Dadayan, principal research associate at the Urban-Brookings Tax Policy Center, said the state’s fiscal situation is a taste of what’s to come for others.

“Unfortunately, governors will have to deal with the budget shortfalls if the economy continues to weaken,” Dadayan said.

Some of the revenue declines aren’t a surprise because lawmakers have been on a tax-cutting spree. Half of US states cut personal or corporate income tax rates, and in many cases both, over the course of 2021 through 2023, according to the Center on Budget and Policy Priorities.

The tax-cutting fever that has gripped statehouses has showed no sign of stopping — even as officials contend with a weaker fiscal environment. New Jersey officials are enacting property tax relief measures for seniors, setting aside a total of $600 million for the program over the next three fiscal years. That’s despite Treasurer Elizabeth Muoio announcing in May that New Jersey expects $1.1 billion less in income tax revenue for 2023 and $1.2 billion less for the fiscal year that starts July 1.

Of course, US states — from California to North Carolina — have never been better prepared for a downturn. They built up record rainy day fund balances.

California, known for booms and busts, has a $38 billion reserve, believed to be the largest of any state in U.S. history, according to a legislative budget committee report. The report said the state’s treasury has “never” had as much cash and resiliency as it has in 2023.

And the stock market is rallying again with the S&P 500 up 15% year-to-date. H.D. Palmer, a spokesperson with California’s Department of Finance, said budget analysts are breathing easier this year as the stock market bounces back from the 2022 rout.

“There’s this normalization of state tax revenue that’s beginning to happen,” said Tammy Gamerman, a director for Fitch Ratings. “The days of these booming revenues have come to an end.”

--With assistance from Martin Z. Braun, Shelly Hagan, Elise Young, Reade Pickert and Michelle Kaske.

This article was provided by Bloomberg News.