Minnesota’s two-week-old government shutdown moved toward resolution Thursday, as Gov. Mark Dayton (D) and Republican legislative leaders agreed to a deal for closing the state’s $5 billion budget gap without a tax increase.

Speaking to reporters outside his office after emerging from a nearly three-hour meeting with GOP legislative leaders, Dayton said that the government shutdown would end as soon as lawmakers flesh out details of the agreement and move them through a special session of the Legislature. Officials said that should happen “within days.”

The agreement to end the shutdown came after Dayton reluctantly acceded to Republican demands not to raise any taxes to balance the state’s two-year budget and to embrace a deal the GOP had proposed just before the shutdown.

Dayton, who wanted to include a tax increase on the state’s top 2 percent of wage earners as part of the mix to close the funding gap, said the refusal of GOP legislators to budge left him with little choice but to go along with their alternative.

The plan would balance the state’s budget by cutting programs, delaying state aid to local school districts and borrowing against future tobacco company settlement payments.

“Despite my serious reservations about your plan, I have concluded that continuing the state government shutdown would be even more destructive for too many Minnesotans,” Dayton said in a letter to GOP legislative leaders. “Therefore, 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.”

Dayton did ask Republicans to back off of their proposals to shrink state government employment by 15 percent in each agency. He also called for policy proposals favored by the GOP to be shelved for the rest of the year. In earlier talks, GOP leaders had pressed for abortion and stem-cell research restrictions, as well as stricter voter identification laws.

Dayton also called for Republican support in passing at least $500 million in bond sales to finance work on publicly owned buildings, including work at state colleges and universities, prisons and public-works facilities.

Those conditions caused some consternation among Republicans, whose leaders, nonetheless, agreed to the framework outlined by Dayton. “We believe the caucus will ultimately support this,” Senate Majority Leader Amy Koch (R) said.

Some Democratic lawmakers were also dissatisfied. “No way can I support this awful ‘compromise’ further tanking schools, deeper debt, kicking the whale down the road,” wrote state Rep. Mindy Greiling (D).

Dayton’s communications director, Katharine Tinucci, stressed that the agreement was a compromise by both sides. “The true sense of a compromise is that no one’s happy,” she said in a statement. “It’s not a win or a loss for any of the politicians involved.”

The battle in Minnesota echoes the ongoing fight over federal spending. As in Washington, Minnesota Republicans refused to consider any new taxes during the partisan wrangling. The fight caused nonessential parts of the state government to close after the new fiscal year began July 1.

Although critical services such as state police and prisons remained in operation, the shutdown closed state parks, made business licenses unobtainable and caused the layoff of more than 20,000 state employees. A rating agency also lowered Minnesota’s bond rating, increasing future borrowing costs for the state.

Republican lawmakers rebuffed several compromise offers from Dayton, who searched futilely for a way to end the impasse without totally abandoning his original position.

“If something works, you keep doing it,” said Larry Jacobs, a University of Minnesota political scientist. “Right now it feels like the Republicans have a winning formula, and it keeps generating concessions for them. They have found a bargaining style that satisfies their hard conservative base and has the Democrats on the defensive.”

Jacobs explained that the shutdown put more pressure on Democrats than Republicans, because of the growing antipathy toward government felt by many Republicans and their fervent belief that taxes and government stifle economic growth.

“For the governor, this was an existential crisis,” Jacobs said. “But many Republicans are so dubious about government and the role it plays that they view this in purely tactical terms.”

Using a shutdown to put pressure on Democrats is “not a lesson that I would say to anybody,” Speaker of the House Kurt Zellers (R) said. “We did not want a shutdown in the first place. We wanted a lights-on bill that would keep the government funded at 70 or 80 percent while we worked this out.”

Zellers viewed the apparent resolution as a Republican victory. “From the standpoint of whether there’s a tax increase or not, absolutely,” he said. “Is there more spending than we wanted? Absolutely.”