In the end, Mark Dayton, the Democratic governor, gave up his wish to raise taxes on the wealthiest Minnesotans and agreed to a set of provisions that Republican leaders had offered him two weeks ago, just before the state closed its parks and sent 22,000 workers home. Still, Republican leaders said they, too, had not gotten all they had wished for: deeper cuts in state spending.

Instead, both sides agreed to balance the state's approximately $35 billion budget by finding an additional $1.4 billion in revenue through some fancy accounting maneuvers — by delaying payments to local school districts (which were unhappy to learn of this) and by borrowing money against expected future payments from the tobacco industry.

Truthout supports itself through tax-deductible donations from our readers. Please make a contribution today to keep truly independent journalism strong! Donate now and your contribution will be doubled by a charitable foundation. Click here to contribute.

Critics complained that the state's political leaders merely delayed Minnesota's financial troubles rather than making hard, lasting decisions about whether to raise taxes or to cut services.

Other Minnesotans wondered aloud what two weeks of a shuttered Capitol, closed highway rest stops and suspended lottery services had been about in the first place, if both sides were now agreeing to an offer that had already been on the table. But others simply expressed relief that the longest and broadest shutdown in state history, and the only one in the nation so far this year, would soon be over.

As of Thursday evening, it was uncertain exactly when the state would officially reopen; legislators need to formally vote on the bills, and that may take several days, officials said.

By this week, the shutdown, which began on July 1, was stretching well beyond public services. Tourist businesses near the state’s closed campgrounds complained that they were losing their crucial summer customers.

About 300 restaurants and bars were unable to renew their state-issued cards allowing them to buy alcohol from distributors. And some Minnesotans were miserably envisioning months more like this.

But on Thursday, Governor Dayton announced that he would agree to terms that Republican lawmakers, who took control this year of both chambers in St. Paul for the first time in almost four decades, had proposed just before the shutdown.

He said he still believed that revenue to pay for what he views as crucial services for the state’s most vulnerable people should come from the wealthiest Minnesotans. But he said he was out of options, and could see that residents wanted this all to end.

“I am willing to agree to something I do not agree with — your proposal — in order to spare our citizens and our state from further damage,” Mr. Dayton wrote to the Republicans.

Mr. Dayton said he wanted to add three new terms to the agreement: the removal of any nonbudget policy matters (some lawmakers had wanted to add issues like embryonic stem cell research) from any deal; the abandonment of plans to make an across-the-board cut of 15 percent of state workers; and support for a bonding bill of at least $500 million “to put people back to work throughout Minnesota.”

By late Thursday afternoon, Mr. Dayton and the Republican’s top leaders emerged from a private meeting that lasted hours, looking sweaty and somewhat glum. Amy Koch, the Senate majority leader, said the deal was “difficult for both sides.” Kurt Zellers, the House speaker, said that for the Republicans, the plan would still spend too much, but that a compromise was needed. “It was about making sure that we get a deal that we can all be disappointed in, but a deal that is done, a budget that was balanced,” Mr. Zellers said.