Minnesotans are spending more than expected and state government is spending less, leading to a financial about-face Tuesday as economists predicted that a state budget deficit had flipped to a $641 million surplus.

State leaders went from figuring out how to patch a hole in the current budget to anticipating some extra dollars, which could be used for priorities like COVID-19 relief. Still, budget officials warned the ongoing pandemic and other factors make the state's financial picture more uncertain than usual.

Tuesday's forecast also looks ahead to the next two-year budget cycle, which starts July 1. Planned spending appears likely to exceed revenue in coming years, leading to a forecast $1.27 billion gap in the next budget. But that shortfall is far smaller than expected seven months ago.

The new numbers set an easier path for Gov. Tim Walz and legislators as they shape a state spending plan for 2022 and 2023. The forecast will be the basis for Walz's budget proposal, which he will debut in January and hash out with lawmakers through the winter and spring.

Walz and legislators also have been waiting for the latest financial prediction as they negotiate a COVID-19 relief package. Lawmakers said Tuesday they hope to reach a deal in the next week or two and send out aid this month.

Economists painted a grim picture during the last forecast in May, as coronavirus cases in the state climbed to 7,851. They thought the current budget would have a $2.4 billion deficit. In July, officials predicted a $4.7 billion gap for the following two years. The pandemic has raged on since then, battering many Minnesotans' pocketbooks and infecting more than 322,000 people.

But higher than expected business investments, and sales and income tax receipts, have cushioned the blow to state finances. Other states with sales taxes also have seen better-than-expected revenue, state economist Laura Kalambokidis said recently, in part because additional federal unemployment insurance payments allowed people to keep buying things. People are spending more on goods, like furniture, and less on in-person services.

A drop in state spending also contributed to the potential surplus and better outlook in the next budget.

The forecast anticipates state spending for the current budget will be $1 billion less than previously projected, and $409 million less in 2022 and 2023.

The state saved money as fewer people used health care services, federal funding for Medical Assistance increased, and public school enrollment declined.

The projected student count fell by 12,600 pupils this year as more families delayed kindergarten, chose private school or home-schooled, Budget Director Britta Reitan said. That's a small percentage of the state's 875,000 students, but results in significant savings, she said.

The uneven financial impact of the coronavirus also affected the numbers, Kalambokidis said.

The state has 184,000 fewer jobs than in February, according to the forecast. People who filed for unemployment insurance were more likely to have held lower-wage jobs, she said.

"You would have expected more of a hit to consumer spending given the level of unemployment, but because the burden was not borne equally — it was borne more by people with lower incomes — then spending did not decline as much as we anticipated," she said.

During the May forecast, economists thought pandemic-induced furloughs, pay reductions and layoffs would lead to a 5.9% drop in total salary and wage income in the state in 2020. But that unequal burden on lower-wage workers meant that drop is not as severe as anticipated.

Total income is now expected to decline by just 1.4% this year, helping keep the state's income tax revenue high.

Walz urged legislators Tuesday to consider who is hurting the most during COVID as they work on a relief bill and shaping the state's next budget.

"There are families and businesses on the brink today. There are more people, one in eight families, wondering where they are going to get their next meal," Walz said. "But the good news of the day is we have the resources and the capacity and fiscal stability and strength to be able to make a real difference in that."

The governor said the aid package in the works would provide a bridge to small businesses and workers whose federal unemployment benefits expire after Christmas, as well as low-income families. He suggested the cost could range from $300 million to $600 million.

House Republicans said Tuesday they want the package just to focus on businesses, but are optimistic about reaching a deal soon. GOP legislators also stressed after the forecast that state government should look for more ways to cut spending in the next budget and avoid raising taxes.

"Right now we have a surplus, and we don't need to raise taxes period. We don't need to do that. And we do need to tighten our belt," Republican Senate Majority Leader Paul Gazelka said.

DFL House Speaker Melissa Hortman warned that the forecast does not account for inflation in the next budget cycle and said the deficit will probably be closer to $2.6 billion. She said a blanket refusal to raise taxes could mean cuts in services for people who have been hit hardest by the COVID-19 pandemic.

Meanwhile, Management and Budget Commissioner Jim Schowalter cautioned that a long list of factors could change Tuesday's forecast, from the timing of a coronavirus vaccines to the pandemic's effect on economic activity to the possibility of another round of federal assistance for states.

Minnesota's full reserves put the state in a relatively strong position to weather that uncertainty. The state has saved $2.4 billion to help navigate economic downturns. But Schowalter said the state should not use too much of the reserves to address a potential gap in the next budget cycle.

"The key long-term thing is that we constantly look at using [the reserves] judiciously in downtimes and making sure we continue to invest in it in better times," he said, "simply because you don't know when you'll need it."