After days of heated debate and intraparty elbow throwing, Gov. Kelly Ayotte and Senate President Sharon Carson (R-Londonderry) reached a deal on the state budget Wednesday afternoon that is expected to pass both chambers on Thursday.

“I am pleased we were able to reach a compromise that delivers a fiscally responsible and balanced budget for all of New Hampshire,” Ayotte said in a statement. “We have protected our most vulnerable, created an even brighter future for our children, and stood up for those who have made our state the safest in the nation.”

Details were still drifting out late Wednesday, but according to sources familiar with the agreement, it includes more money for Group II retirees than in the budget agreement passed by the Committee of Conference. That’s a win for Ayotte.

However, the deal also includes a $145,000 cap on future retirements to avoid “spiking” — the practice of running up income with overtime and additional work to artificially increase the baseline used to calculate pensions. The deal also changes the formula from the highest three years of income to the highest five years, making it harder to “spike” salaries. Those are wins for Carson.

“It’s a deal nobody’s going to love, but everybody can live with,” one legislator told NHJournal.

According to multiple sources, the best thing about the deal is that it exists. Ayotte didn’t want to veto her first budget, particularly one crafted by her fellow Republicans, and legislators were not looking forward to a dragged-out process, either under a continuing resolution or in a special session.

While many in the legislature were saying a veto was inevitable, House Majority Leader Jason Osborne was using social media to hint that a deal was in the works.

“Three days is an eternity in political time. Anything is possible if the right people get together,” he tweeted on Monday. On Tuesday, he added, “Never stop running plays until the clock runs out.”

On Wednesday, as the deal was coming together behind closed doors, he had a public message for his fellow Republicans: “Up by three points. Got possession with 30 seconds left on the clock. Don’t fumble.”

What Osborne needs is for his caucus to support the final budget and not to kill the Group II pension side deal. It must pass Thursday for things to go forward. The New Hampshire House is an unpredictable place, but Osborne has gotten some good news.

Rep. Mike Bordes (R-Laconia), denounced by some Republicans as a “liberal” and one of the House members most likely to break with his party, has said he’s supporting the deal. “Great job by our governor!”

And Rep. Michael Granger (R-Milton) with the House Liberty Caucus released a statement on Monday saying his group was supporting the budget, even before the deal was announced.

“It is often said that the sign of a good compromise is that both sides walk away unhappy, and this is surely the case,” Granger said.

The state Senate will vote first, with the House watching closely.

The two-year, $15.6 billion budget is significantly larger than the spending bill originally passed by the House of Representatives. According to the Josiah Barlett Center for Public Policy, the budget deal passed by legislators “spends $6.34 billion from the General and Education Trust Funds, which represent the portion of the state budget funded by state tax revenues. That’s a $91 million, or 1.45 percent, increase over the previous state budget as passed.”

“Including additions made by the Committee of Conference to FY 25 appropriations, the budget raises total spending during the FY 2024-25 biennium from the appropriated $6.25 billion to $6.5 billion.