The deal came less than two weeks before the limit on US government debt was due to be reached.
Senators in the United States have voted to temporarily extend the country’s debt ceiling, less than two weeks before it was due to be reached.
Disagreements over the ceiling – the limit on how much the government can borrow – are not new in US politics.
But the ongoing row between Republicans and Democrats has caused jitters in the financial markets.
There were fears that the US would default on its national debt, with catastrophic global implications.
The Senate, the upper chamber of Congress, decided on Thursday by a vote of 50-48 to extend the debt ceiling until early December. The bill will now be sent to the House of Representatives for approval before it can be sent to President Biden for his signature.
The temporary measure raises the US debt ceiling to $480 billion (£352 billion).
The vote was held hours after Senate Majority leader Chuck Schumer, a Democrat, announced that a deal had been reached.
The announcement came after what Schumer’s Republican counterpart Mitch McConnell said were negotiations “in good faith” that had continued through the night.
The agreement comes less than two weeks before 18 October, the day the US Treasury Secretary Janet Yellen warned was the deadline to prevent the first ever US default. The House Majority leader, Steny Hoyer, said that vote in the House of Representatives will be held on Tuesday.
US lawmakers will still have to address this issue near the new December deadline to avert a default.
If the US defaulted on debts analysts say it would severely hurt the country’s credit rating, plunge the global financial system into turmoil, and possibly lead to a self-inflicted recession.
Speaking after the vote Mr Schumer said Republicans had “played a dangerous and risky partisan game”. He added that “what is needed now is a long-term solution so we don’t go through this risky drama every few months”.
Meanwhile, several senior Republicans have attacked Mr McConnell’s decision to strike a deal with Mr Schumer. South Carolina Senator Lindsey Graham called the move “a complete capitulation”.
The US government spends more money than it collects in taxes, so it borrows to make up for the shortfall.
Borrowing is done via the US Treasury, through the issuing of bonds. US government bonds are seen as among the world’s safest and most reliable investments.
In 1939, Congress established an aggregate limit or “ceiling” on how much debt the government can accumulate.
The ceiling has been lifted on more than 100 occasions to allow the government to borrow more. Congress often acts on it in a bipartisan manner and it is rarely the subject of a political standoff.
But some Republicans have voiced frustration around new spending proposals that Democrats are trying to push through without Republican support.
Democrats have pointed out that raising the debt ceiling is about paying off existing obligations rather than paying for new ones, and that President Joe Biden’s policies have only contributed to 3% of existing debts.