The US Congress has reached a two-year budget agreement in a rare bipartisan breakthrough that would avoid both a looming debt crisis and a potential shutdown of the federal government in December.



Leaders in the House of Representatives formally announced the deal on Tuesday following the conclusion of behind-the-scenes negotiations that dragged late into the night on Capitol Hill. The pact would notably take volatile issues like the debt limit and government funding off the table until after the 2016 presidential election, thus paving the way for soon-to-be speaker of the House Paul Ryan to ease into his new role as John Boehner resigns from Congress.



The deal also provides relief to federal budget cuts known as sequestration, which kicked in more than two years ago as the result of an impasse despite chagrin on both sides. Under the agreement, the Pentagon and domestic agencies will see a boost in $80bn each in exchange for cuts elsewhere in the budget.



Boehner said he was optimistic about the deal’s prospects, which is expected to get a vote in the House as early as Wednesday.

“It’s going to pass with a bipartisan majority,” the outgoing speaker said at a Tuesday press conference.



“The agreement isn’t perfect by any means ... but the alternative was a clean debt ceiling or a default on our debt. It also means when we got to [December], we were facing another government shutdown. So when you look at the alternative, it starts to look a lot better.”

House conservatives nonetheless grumbled almost immediately after the deal was struck – a sentiment that was not lost on Ryan, who moved to distance himself from the process by which the deal was reached despite his own involvement in similar budget negotiations just two years ago.



“I’m reserving judgment on this agreement because I quite frankly haven’t seen it,” Ryan told NBC News. “If you want to ask me what I think about this process, I think this process stinks. Under new management we are not going to run the House this way.”



Congress sidesteps government shutdown as Boehner prepares for exit Read more

Even so, the measure is largely viewed as a gift from Boehner to Ryan aimed at ensuring that his ascension to the speakership is relatively smooth and void of the high-stakes drama that led Boehner to announce an early retirement last month.



Boehner had promised to clear away as much business as possible before handing his speaker’s gavel to Ryan, in what Boehner referred to it as “cleaning out the barn”.

“I didn’t want him to walk into a dirty barn full of you-know-what,” Boehner said Tuedsay.



The White House also threw its support behind the agreement, telling reporters Tuesday it met the president’s tests by adequately funding both defense and domestic spending while averting the kind of crises that have gridlocked Washington in the past.



“We believe this a budget framework that meets the president’s vision,” said Eric Schultz, Obama’s deputy spokesman.



“Obviously this is a compromise. Not everyone in this situation is going to get everything they want.”

Schultz added that Obama was “heavily engaged” in the negotiations, unlike the process under which previous budget agreements were struck.

The new budget plan would restore order to Washington and remove the threat of budget and debt chaos – a premier goal of congressional Republicans such as the Senate majority leader, Mitch McConnell of Kentucky, a key architect of the pact.



Capitol Hill Democrats are likely to solidly support the agreement, although it gives greater budget relief to the Pentagon than it does domestic programs.



Harry Reid, the Senate Democratic leader, expressed his support for deal in a statement on Tuesday.



“Democrats and Republicans have come to a responsible agreement that places the needs of our nation above Republicans’ partisan agenda,” Reid said. “While this agreement is not perfect, it addresses both investment in domestic priorities that benefit the middle class and defense spending. And with this agreement, we avoid a major threat to jobs and the economy.”

The legislation would suspend the current $18.1tn debt limit through March 2017. The budget portion would increase the current “caps” on total agency spending by $50bn in 2016 and $30bn in 2017, offset by savings elsewhere in the budget. And it would permit about $16bn to be added on top of that in 2016, classified as war funding, with a comparable boost in 2017.

It would also clean up expected problems in social security and Medicare by fixing a shortfall looming next year in social security payments to the disabled, as well as a large increase in Medicare premiums and deductibles for doctors’ visits and other outpatient care.

The emerging budget side of the deal resembles a pact that Ryan fashioned two years ago in concert with the Democratic senator Patty Murray to ease automatic spending cuts for the 2014-15 budget years. Many conservatives disliked the measure and a number on the GOP’s right flank are already swinging against the new one, which would apply to the 2016-17 budget years.

“I’m not excited about it at all,” Representative Matt Salmon said of the agreement. He called it “a two-year budget deal that raises the debt ceiling for basically the entire term of this presidency”.

Boehner was pushed aside by conservatives in his own party after repeatedly turning to Democrats to pass must-do legislation in an era of divided government. Many Republicans also resented being kept in the dark. The pending deal fits both criteria.



Boehner waved off the criticism, noting he had informed his members in a closed-door meeting on Tuesday morning there was no reason anyone should vote against it.



Assuming all 188 Democrats voted for the measure, it would need the backing of at least 30 Republicans to pass the House. Oklahoma representative Tom Cole, a key ally of Boehner’s and House deputy whip, said he expected a strong vote among Republicans.



Among the proposed spending cuts are curbs on Medicare payments for outpatient services provided by hospitals that have taken over doctors’ practices, and an extension of a two-percentage-point cut in Medicare payments to doctors through the end of a 10-year budget.

The budget side of the deal is aimed at undoing automatic spending cuts which are a byproduct of a 2011 budget and debt agreement, and the failure of Washington to subsequently tackle the government’s fiscal woes. GOP defense hawks are a driving force, intent on reversing the automatic cuts and getting more money for the military. A key priority for Democrats is to boost domestic programs.

The focus is on setting a new overall spending limit for agencies whose operating budgets are set by Congress each year. It will be up to the House and Senate appropriations committees to produce a detailed omnibus spending bill by the 11 December deadline.