Updated

Minnesota Gov. Mark Dayton has signed a new budget that ends the nation's longest state government shutdown in the past decade and returns 22,000 state workers to their jobs.

Dayton's signature came Wednesday after lawmakers met in special session Tuesday to give their own approval to the deal. The vote formalized an agreement Dayton struck with leading Republicans late last week.

The state House and Senate approved the budget during a special session, with the last vote coming around 3:30 a.m. Wednesday. The session adjourned a few minutes after the last budget bills passed.

The nearly three-week government stoppage sullied Minnesota's reputation for good government, while disrupting lives and businesses around the state. It closed state parks and stopped highway construction projects, suspended lottery ticket sales and some services to the vulnerable and even interrupted the flow of alcohol to some bars.

Democrats and Republicans argued bitterly over taxes and spending for months, and the impasse became a crisis when government shut down July 1 because no budget was approved.

In the end, Dayton gave up on tax increases but Republicans in turn agreed to soften spending cuts with $1.4 billion in new revenue by delaying state aid payments to schools and borrowing against future payments from a legal settlement with tobacco companies.

"This represents a compromise," said Sen. Julianne Ortman, R-Chanhassen, as she argued in favor of the tobacco borrowing. "I think there are 201 of us plus a governor who would say this isn't our best option on how to proceed, but it is the best option for bringing Minnesota government back to work."

The Associated Press contributed to this report.