CNN  — 

The US House of Representatives voted overwhelmingly on Wednesday to pass a bill to suspend the nation’s debt limit through January 1, 2025, as lawmakers race to prevent a catastrophic default.

The bill will next need to be passed by the Senate before it can be sent to President Joe Biden to be signed into law. In the Senate, any one lawmaker can delay a swift vote and it is not yet clear when a final vote will take place.

The timeframe to pass the bill through Congress is extremely tight and there is little room for error, putting enormous pressure on leadership in both parties.

Lawmakers are racing the clock to avert a first-ever default ahead of June 5, the date the Treasury Department has said it will no longer be able to pay all of the nation’s obligations in full and on time, a scenario that could trigger global economic catastrophe.

The debt limit bill faced backlash from the far right and the far left, but in the end it passed the House by a wide margin with significant bipartisan support.

The final tally for the vote was 314 to 117. There were 149 Republicans and 165 Democrats who voted for the bill and 71 Republicans and 46 Democrats who voted against it.

Suspending the debt limit through 2025 takes the threat of default off table until after the presidential election. In addition to addressing the debt limit, the bill caps non-defense spending, expands work requirements for some food stamp recipients and claws back some Covid-19 relief funds, among other policy provisions.

The bipartisan debt limit deal struck between the White House and House Republicans was announced over the weekend – the culmination of long days and late nights of contentious negotiations that at times looked like they might breakdown and fall apart entirely. The effort to secure a debt limit deal has proven to be a major leadership test for both House Speaker Kevin McCarthy and Biden.

“I have been clear that the only path forward is a bipartisan compromise that can earn the support of both parties,” Biden said, praising the House vote in a statement moments after the bill’s passage. “This agreement meets that test. I urge the Senate to pass it as quickly as possible so that I can sign it into law, and our country can continue building the strongest economy in the world.”

McCarthy took a victory lap after the House passed the deal, saying: “I have been thinking about this day since before my vote for speaker because I knew the debt ceiling was coming. I wanted to make history.”

The speaker and his top allies expressed confidence ahead of the vote that the deal would pass in the House. “I am confident we will pass the bill,” McCarthy told reporters at the Capitol on Tuesday.

Earlier Wednesday, the chamber cleared a key hurdle to advance to a final vote when it approved a rule governing floor debate for the debt limit bill. Rules are typically supported by just the majority party and opposed by the minority. But in this case, 52 Democrats voted “yes” to get the rule across the finish line after 29 Republicans voted against it.

Democratic leaders instructed their members to let Republicans put up their votes for the rule first, a source familiar told CNN. The strategy: let Republicans sweat and show how many defections GOP leaders had. The defections exposed deep divisions within the House Republican conference.

Passage of the rule cleared the way for the final House vote on the bill later in the day.

The Congressional Budget Office told McCarthy in a letter Tuesday night that the bill would reduce budget deficits by $1.5 trillion over the next ten years. The letter says that if the bill is enacted, “mandatory spending would, on net, decrease by $10 billion, and revenues would, on net, decrease by $2 billion over the 2023–2033 period,” the agency wrote. “As a consequence, interest on the public debt would decline by $188 billion.” Discretionary spending would be reduced by a projected $1.3 trillion over the 2024-2033 period.

But in a troubling sign for McCarthy, the CBO also warned that changes to the work requirement provisions in the food stamps program “would increase federal spending by about $2.1 billion over the 2023-2033 period.” The bill would increase the upper age limit of the existing work requirement through age 54, but veterans, homeless Americans and former foster youth of all ages would be exempt. Combined, these provisions would increase the number of people receiving benefits by about 78,000 people in an average month during the 2025 to 2030 period, when they were fully in effect, according to the agency.

This headline and story have been updated with additional developments.

CNN’s Melanie Zanona, Lauren Fox, Morgan Rimmer and Tami Luhby contributed to this report.