TOPEKA — Lawmakers mustered enough votes early today to pass a budget that anticipates painful future cuts to state government, but not before several Republicans delivered blistering assessments of the state’s financial health.

The House and Senate approved a budget deal in close votes after wrenching debates in the dark hours of the morning — then quickly wrapped their regular session for the year.

The deal that passed and now heads to Gov. Sam Brownback does not balance the budget. Instead, it assumes the governor will make millions in politically painful cuts and sweeps during an election year, as lawmakers fight to retain their seats amid simmering dissatisfaction with the state’s fiscal situation and its chief executive.

The legislation, which Brownback has indicated he can sign, narrows the state’s quarter-billion dollar budget shortfall. According to estimates, the deal — Senate Bill 249 — will leave the state with approximately $27 million during the current fiscal year and $81 million during the next year, which begins July 1.

But revenues consistently have fallen short of projections during the past two years, a fact not lost on legislators.

“Those of us who come back next year better start figuring this out,” said Sen. Jeff Longbine, an Emporia Republican. “And whether it’s revenue or cuts, or a combination of both — but we cannot continue to play the shell game. We cannot continue to move money around. We cannot continue to not pay our bills.”

When anticipated cuts by Brownback are taken into account, the budget deal theoretically leaves the state with a $35 million ending balance during the current fiscal year, and an $81 million balance during the next year, which begins July 1.

The budget package assumes $82 million in cuts by Brownback and a $115 million sweep from the state highway fund next year. At the same time, it prohibits cuts to K-12 public schools, while forcing the University of Kansas and Kansas State University to bear a greater burden than other state universities if the governor cuts higher education in the future, while at the same time removing a cap on tuition increases.

It also further delays a nearly $100 million payment into the state pensions system but specifies tobacco settlement money above what is set aside for children’s programs will go toward KPERS, as well as any revenue that comes in above expectations. The payment will have to be made by June 2018.

“There are a number of very painful, painful cuts,” said Rep. John Henry, D-Atchison. “And those cuts will be received by some of the most vulnerable people of our society.”

The bill’s lead proponent in the Senate offered a less than enthusiastic endorsement.

The Senate Ways and Means Chairman, Sen. Ty Masterson, made clear through his comments he viewed the deal as the best package available given the circumstances.

“We have not shown the fortitude to make other changes in either chamber, whether it’s accounting correctly or doing it through taxation or through cuts that we would take — we have not shown the fortitude to do this,” said Masterson, R-Andover.

“This bill, I believe, represents the best that we can do it. Everybody’s sufficiently uncomfortable, but that’s generally what it takes to get compromise out of this chamber.”

House Appropriations Chairman Rep. Ron Ryckman, Jr., R-Olathe, argued the deal holds fast to promises of stable funding for schools.

The Legislature faces an ongoing legal challenge over whether state funding for schools is equitable and adequate.

The House kicked off debate on the legislation just after midnight. The deal passed the chamber 63-59, the bare minimum needed. The House adjourned shortly after.

The Senate debate began during the 2 a.m. hour and finished with a more dramatic flourish. When senators voted, the bill initially was failing by four votes, prompting a call of the Senate and a search for Sen. Tom Arpke, R-Salina, who was missing.

Several minutes into the call — and a supposed search for Arpke — Sen. David Haley, D-Kansas City, asked Senate President Susan Wagle, R-Wichita, for an update. Wagle said she was confident the Senate would reach the 21 votes needed to pass.

Haley replied he was “listening closely for the sound of breaking arms” — a reference to arm-twisting for votes — but hadn’t heard any.

As if on cue, a handful of Republicans who had been voting no began switching to yes, but did so after giving speeches critical of the state’s finances. Arpke also emerged from a door that leads to the Senate President and Senate Majority Leader’s offices.

He voted yes, and said — apparently joking — he had returned from Alaska.

In the end, the Senate passed the bill 22-18. The chamber adjourned at 3:29 a.m., putting an end to the 2016 regular session.

The budget debates came after a failed effort last week to roll back tax breaks for businesses, a key provision of the 2012 tax cuts championed by Brownback. The House rejected a bill eliminating the exemptions. A bill in the Senate did not advance out of committee.

Sen. Ralph Ostmeyer, R-Grinnell, said lawmakers should have shoved Brownback into a corner and forced him to confront legislation repealing the tax breaks.

Last year, Brownback threatened to veto any changes but appeared less certain this year.

Ultimately, Ostmeyer voted yes on the budget deal, though he wasn’t happy about it. The senator chided Republicans and Democrats for failing to act to improve the state’s fiscal health.

“I support this governor. I’ve stuck with him, and I’m catching hell. He’s a friend, I believe in him and he’s a good person. But for some reason we’re refusing to govern as Republicans. And I’m going to be honest with them — my partners across the aisle — just sitting on their hands and being ‘no, no, no,’ ” Ostmeyer said.

The budget includes some measures popular among legislators. It boosts pay for some state hospital workers. It provides for the live streaming of legislative committee meetings.

And it blocks demolition of the Docking State Office Building after lawmakers perceived the administration had made secretive efforts to advance closer to demolition.

What remains unclear is what, if any, provisions Brownback will exercise his line-item veto authority over, as well as the specific cuts he will make to bring the budget into balance.

Lawmakers from both parties said expecting the governor to make such large cuts represented an abdication of legislative responsibility. Sen. Greg Smith, R-Overland Park, warned against concentrating power in the executive branch.

Legislators appeared to agree more action must be taken next year, but split on approaches. Some insisted the state faces a spending problem.

Others, like Sen. Laura Kelly, D-Topeka, said revenue — and the 2012 tax cuts — remain at the core of the budget problems Kansas faces.

“I think we’ve spent this whole session avoiding the real issue,” Kelly said. “It’s clear, nobody wants to admit it, we keep saying it’s not true, but we really do have a revenue problem.”