The House on Wednesday passed a two-year, bipartisan budget deal that ends continuous, stop-gap fixes and fights over defense and domestic spending and federal borrowing.

The deal was crafted by House Speaker John Boehner as perhaps his final major accomplishment before his planned departure Friday, despite opposition from the chamber’s farm-state and most conservative Republican members.

The retiring Ohio Republican got support from 79 House Republicans and all 187 chamber Democrats to pass the bill and send it to the GOP-run Senate for a vote as early as next week.

Boehner, who was pushed out by the House Republican Conference’s most conservative members, said before the vote that the agreement was "the best possible deal at this moment for our troops, for taxpayers and for the American people." 

The deal provides an extra $80 billion, divided evenly between the Pentagon and domestic agencies over the next two years, and extend the government's authority to borrow to pay bills into March 2017, as President Obama's successor settles into the White House. 

More On This...

“Today we had a major victory in the House,” California Rep. Nancy Pelosi, the chamber’s top Democrat, said after the vote. “It was a victory for bipartisanship. … We honored the full faith and credit of the United States of America.”

Without the deal, the federal government also would have default on its debt Tuesday and would have been forced into a partial government shutdown in mid-December, without the agreement.

"What has been produced will go a long way toward relieving the uncertainty hanging over us,” said Wisconsin GOP Rep. Paul Ryan, who on Wednesday won the Republican nomination to become the next speaker and is expected to win the full chamber vote Thursday. “It's time for us to turn the page on the last few years and get to work on a bold agenda that we can take to the American people." 

While failing to pass a budget would certainly hurt both parties during the 2016 White House race, voters in recent years appear to have placed most of the blamed on Republicans.

Still, Kentucky Sen. Rand Paul, a Republican presidential candidate, has promised a filibuster when the deal arrives to his chamber, calling it a capitulation that illustrates "why the grassroots Republicans are so angry with establishment Republicans."

His stall tactic was clipped after the vote when Senate Majority Leader Mitch McConnell, R-Ky., filed a parliamentary procedure known as cloture that would limit Paul's effort to roughly 30 hours. 

The additional spending in the deal would be financed by a potpourri of savings including sales of millions of gallons from the nation's Strategic Petroleum Reserve, curbs on Medicare reimbursements to hospitals and doctors and tougher federal debt collection, including allowing federal agents to call people's cell phones. 

The deal also would trim federal subsidies to companies that sell crop insurance to farmers, creating an uproar among agriculture-state lawmakers. 

The package would also avert a looming shortfall in the Social Security disability trust fund that threatened to limit benefits, and head off an unprecedented increase in Medicare premiums for doctors' visits for about 15 million beneficiaries.

The Associated Press contributed to this report.