The House on Wednesday night approved a bill to raise the nation's debt ceiling while cutting some government spending over the next two years, in a major victory for both the White House and Republican leaders as the country tip-toes closer to a historic default on its bills.
The final vote was 314-117.
A majority of the GOP conference backed the legislation, with 149 votes, but it was 165 Democrats who helped ensure passage as 71 conservatives ultimately voted no, as did 46 Democrats. Four lawmakers, two Republicans and two Democrats, didn't vote.
The proposal next heads to the Senate, where both Majority Leader Chuck Schumer and Minority Leader Mitch McConnell have said they want to move quickly to approve it -- even as soon as Thursday or Friday.
The deal, brokered between President Joe Biden and House Speaker Kevin McCarthy, would raise the country's $31.4 trillion borrowing limit until January 2025 while setting a broad government budget over the next two years and making some policy changes, such as increasing work requirements on federal food assistance.
MORE: Why debt ceiling bill is a major test of Kevin McCarthy's leadershipTreasury Secretary Janet Yellen has estimated that the government will run out of cash to pay all of its bills by Monday -- the so-called "X-date" for default.
But the Fiscal Responsibility Act, which passed the House on Wednesday, includes a two-year government budget in exchange for lifting the debt ceiling through Jan. 1, 2025.
The bill would keep non-defense spending flat in fiscal 2024 and increase levels by 1% in fiscal 2025.
Speaking with reporters after the vote, McCarthy touted what he called Republicans' work in getting the White House to compromise and he highlighted the cuts and savings he said his party had exacted in light of the currently divided federal government.
"I knew the debt ceiling was coming. I wanted to make history. I wanted to do something no other Congress has done, that we would literally turn the ship, that for the first time in quite some time we'd spend less than we spent the year before," he said. "Tonight, we all make history."
"Is it everything I wanted? No," McCarthy said. But "sitting with one House, with a Democratic Senate and a Democratic president who didn't want to meet with us, I think we did pretty dang good for the American public."
In a statement of his own, Biden applauded the House for taking a "critical step forward" in passing the agreement and specifically thanked McCarthy "and his team for negotiating in good faith."
"This budget agreement is a bipartisan compromise. Neither side got everything it wanted. That’s the responsibility of governing," he said.
The president said that the deal protects key parts of his agenda, as well as government programs like Medicare and Social Security.
Despite Biden and McCarthy's celebratory tones, their deal had drawn bipartisan criticism, too -- a notable minority of the House.
Some Republicans said the speaker had not gone far enough in getting sweeping spending cuts, similar to a House bill that passed along party lines in April.
Rep. Dan Bishop, R-N.C., told ABC News that he had 'zero" confidence in McCarthy and said, "I’m just fed up with the lies. I'm fed up with the lack of courage, the cowardice."
Progressive Democrats, for their part, said Biden had given in to what they likened to economic hostage-taking in agreeing to some spending cuts without holding to his demand that Republicans raise the debt ceiling without preconditions.
At his post-vote press conference, the speaker steered away from questions about the possibility that his members may introduce a motion to boot him from his leadership role. Even so, he acknowledged the fractions within the House GOP conference.
“I know the country is divided,” he said. “I watched Congress divide. I watched my own Congress, my own conference. I will work to make sure everybody comes back. It might not be easy, but it’s too important to let go.”
ABC News' Alexandra Hutzler, Molly Nagle and Trish Turner contributed to this report.