US lawmakers voted to raise the federal debt limit on Wednesday, eliminating the threat of a disastrous credit default with just hours to spare ahead of the deadline set by the Treasury.

The deeply divided Senate voted Tuesday to raise the borrowing cap by $2.5 trillion and the House of Representatives, the lower chamber of Congress, followed suit in the early hours of the following morning -- staving off the next showdown until at least 2023.

"No brinksmanship, no default on the debt, no risk of another recession: responsible governing has won on this exceedingly important issue," Senate Majority Leader Chuck Schumer said on the floor ahead of the votes.

"The American people can breathe easy and rest assured there will not be a default."

The vote in both chambers of Congress followed party lines, with Republicans offering just one vote in the House to deliver the country from potential disaster, and no votes at all in the Senate.

Both parties see raising the debt ceiling as politically toxic, although they acknowledge that failure to do so would plunge the US economy into a depression and roil world markets as the government missed debt repayments.

Republicans especially hope to weaponize the extension to campaign against Democratic "overspending" in the 2022 midterm legislative elections, although it would only cover commitments already made by both parties.

The two sides agreed last week to create a one-off law allowing Democrats to lift the nation's borrowing authority without help from the opposition Republicans.

The legislative sleight-of-hand circumvented the "filibuster" rule, so that the required 60-40 margin could be abandoned for this vote only, in favor of a simple majority -- allowing Republicans essentially to stand on the sidelines.

Senate Majority Leader Chuck Schumer (R) and Minority Leader Mitch McConnell have been at odds for months over how to address the debt limit
Senate Majority Leader Chuck Schumer (R) and Minority Leader Mitch McConnell have been at odds for months over how to address the debt limit AFP / Nicholas Kamm

The Bipartisan Policy Center, an independent Washington-based think tank, predicted the United States would no longer be able to service its debts sometime after December 21, although Treasury Secretary Janet Yellen set the deadline at the start of the business day on Wednesday.

America spends more money than it collects through taxation, so it borrows money via the issuing of government bonds, seen as among the world's most reliable investments.

Around 80 years ago, lawmakers introduced a limit on how much federal debt could be accrued.

The ceiling has been lifted dozens of times to allow the government to meet its spending commitments -- usually without drama and with the support of both parties -- and stands at around $29 trillion.

The new borrowing cap will be $31.5 trillion.

Democratic leaders have spent weeks underlining the havoc that a default would have wrought, including the loss of an estimated six million jobs and $15 trillion in household wealth, as well as increased costs for mortgages and other borrowing.

"Addressing the debt limit is a basic responsibility of the federal government," the White House said in a statement.

"Passage of this legislation will allow the Treasury to finance spending and tax cuts Congress has already authorized and to keep its commitments without causing disruption or harm to our economy and American families."