ST. PAUL, Minn. — Minnesota lawmakers have a $329 million surplus to work with this year, according to an updated financial forecast released Wednesday that reversed previous indications that the state may face a small budget deficit.

Gov. Mark Dayton and legislative leaders entered the session last week expecting some extra cash, despite a December projection that the Legislature would be forced to fill a $188 million shortfall. Lawmakers were skeptical about that supposed deficit, noting it could easily be reversed by an economic surge powered by new federal tax cuts and the anticipated renewal of federal funding for the state Children’s Health Insurance Program.

And that’s largely how it played out. Minnesota Management and Budget said the $517 million swing was powered by federal reauthorization of federal funding for the youth health care program and new tax breaks, as well as lower-than-expected government spending.

State officials were expected to address the budget news Wednesday afternoon.

The surplus continues Minnesota’s strong financial performance over the last four years. And it also sets the stage for a three-month legislative session just getting underway.

One of the Republican-controlled Legislature’s top priorities for 2018 was squaring the state’s tax code with the recent federal tax overhaul, a cumbersome process to ensure residents aren’t faced with a logistical nightmare when filing taxes next year without inadvertently raising taxes on some small businesses or families with several children.

But Dayton and lawmakers may also leverage the budget surplus to fund safety improvements at Minnesota schools in the wake of the deadly Florida school shooting this month. Dayton indicated that should be a top goal for Minnesota policymakers this year.

Wednesday’s economic forecast also showed that the state was poised to enter its next budget-setting cycle next year with a “modest structural balance” in the budget.