Carolyn Kaster / AP

Updated October 27, 2015, 8:46 a.m.

Congressional negotiators struck a two-year budget deal late Monday night that would increase federal spending by $80 billion and protect the nation from a debt default through the end of the Obama presidency.

The 144-page agreement was posted shortly before midnight, setting up a vote in the House on Wednesday as Speaker John Boehner tries to rush the bill through Congress before the expected election of Paul Ryan on Thursday. Passage of the proposal would raise the debt limit through March 2017, although lawmakers would still have to pass a separate omnibus spending bill by December 10 to avert a government shutdown. The Treasury Department has said Congress must approve new borrowing authority by November 3 to avoid an unprecedented default.

The deal is the most significant fiscal agreement in Congress in two years and would fulfill Boehner’s desire to “clean the barn up” for his successor. Meeting demands from Obama and congressional Republicans, spending would increase by an equal amount for defense and domestic programs, relaxing the caps under “sequestration” enacted in 2011. But the deal also pushes harder decisions down the road, since it extends spending limits by another two years until 2025. The spending increases would also be offset by changes to the crop insurance program and by allowing the government to make automated calls to cell phones to collect debts. And it would raise money through the sale of oil from the Strategic Petroleum Reserve. The bill cancels $1.5 billion from the Justice Department’s crime victims fund and nearly $750 million from the assets forfeiture fund.

Democrats won changes to Medicare that would protect millions of seniors from premium increases, while Republicans secured changes to the Social Security Disability Insurance program that they say would save $168 billion over 10 years while preventing immediate benefit cuts. That provision is likely to cause concern among liberals who oppose any alteration to Social Security that does not expand benefits for recipients. Seeking to head off those worries, Nancy Pelosi, the House Democratic leader, quickly praised the agreement and said it “represents real progress for hard-working families.” The changes to Social Security, she said, would “extend the solvency” of the insurance fund. Republicans also secured the repeal of another provision in Obamacare that requires large businesses to automatically re-enroll employees in a healthcare plan.

As expected, conservative groups immediately panned what they called a “zombie budget deal.” “This budget and debt deal is being brokered by a lame duck speaker and a lame duck president,” the leaders of Club for Growth and Heritage Action said in a joint statement. “It represents the very worst of Washington—a last minute deal that increases spending and debt under the auspices of fiscal responsibility.”

October 26, 2015, 3:55 p.m.

John Boehner might get to “clean the barn up” before he leaves, after all.

The departing speaker and Democratic negotiators are closing in on a fiscal agreement that would bring budget peace—and more federal spending—to Washington for the remainder of the Obama presidency while staving off the possibility of a debt default through March 2017, according to a senior congressional official briefed on the talks. The deal could still fall through, but party leaders hope to complete it Monday night so that the House could vote by Wednesday, just a day before Boehner is expected to hand his speaker’s gavel to Paul Ryan. And in a sign of optimism, House Republicans called an emergency meeting of the conference for Monday evening to discuss the talks.

If completed, the agreement would be the most significant spending accord in two years and perhaps since 2011, when the White House and congressional Republicans enacted deep spending cuts in exchange for an increase in the debt ceiling. Obama and some Republicans have been trying to undo part of those cuts, known as sequestration, ever since—GOP defense hawks want to lift budget caps for the Pentagon, while the president has refused to do so unless he can get an equivalent increase in domestic spending. Under the emerging agreement, that’s what would happen. Money for defense and non-defense accounts would go up by about $50 billion this year and another $30 billion in fiscal 2017, according to Politico. The deal would also prevent steep premium increases for millions of Medicare beneficiaries, the House official said, in a win for Democratic negotiators. (The official spoke on condition of anonymity, because the negotiations are ongoing.) CNN is reporting that the spending increases would be offset by oil sales from the Strategic Petroleum Reserve, higher fees for telecommunications companies, and changes to the crop insurance program.

In political terms, the agreement would be a victory for three people in particular. Boehner would succeed in his stated goal of (mostly) clearing the deck of big issues for his successor. Ryan, who has barely won the support of hardliners in the House, would be spared the challenge of having to negotiate contentious fiscal agreements within weeks of assuming the speakership. And Obama would walk away victorious in his bid for Congress to relax spending restraints now that the economy has improved and the budget gap has shrunk (at least for the next few years). The president would also get relief in another respect: By removing the shadow of a possible government shutdown or default, he stands a better chance of seeing Congress act on his other priorities—namely criminal-justice reform—in his remaining 14 months in office.

In brief speeches on the Senate floor Monday afternoon, Senate Majority Leader Mitch McConnell and Minority Leader Harry Reid confirmed that fiscal negotiations were ongoing but that no deal, as of yet, had been reached. Josh Earnest, the White House press secretary, delivered a similar message across town. “As I stand here today, not everything has been agreed to. That means nothing has been agreed to,” he told reporters.

Any budget agreement would face immediate condemnation from fiscal conservatives in both the House and Senate, who have fought against any reversal of spending cuts that they see as the GOP’s one concrete policy achievement of the last five years. And although it would be in Ryan’s best interest, its completion this week would make for a difficult 24 hours on Wednesday and Thursday, when he must stand for election first among his Republican peers and then in a public vote on the House floor. The hardliners who have opposed his candidacy for speaker would undoubtedly demand that he fight against the fiscal deal. Yet Congress has shown repeatedly over the last few years that in the rare instances when bipartisan deals are struck between Republican leaders and the White House, the center can hold against opposition from the right and left, especially when Obama can rally Democrats in support of his position.

The potential agreement does not include everything Democrats have sought. It does not, according to the House official, include a long-term transportation bill to replenish the Highway Trust Fund, which runs out of cash this month. (Congress is expected to pass a temporary fix to buy more time otherwise.) And it does not address the Export-Import Bank, which saw its charter expire earlier this year. But a bipartisan coalition looks likely to revive the 80-year-old lending agency through other means, making its inclusion in the budget deal less of an imperative. So Boehner’s barn might not be spotless, but if he can seal a deal that sets a two-year budget and dispenses with the debt-limit drama, it will be a pretty significant sweep.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.