The US Senate has voted to temporarily raise the nation's debt limit, avoiding a historic default that experts say would have devastated the economy.
Senators agreed to increase the limit by $480bn (£352bn), which will cover the US until early December.
The bill was approved in a 50-48 vote, following weeks of partisan fighting.
The breakthrough came less than two weeks before the US was set to be unable to borrow money or pay off loans for the first time ever.
The bill now has to be approved by the House of Representatives, and will then be sent to President Joe Biden to be signed into law.
The vote in the upper house of Congress came after Republican Senate leader Mitch McConnell offered his support for a short-term extension.
Senate Republicans have previously said that raising the debt limit is the "sole responsibility" of Democrats because they hold power in the White House and both chambers of Congress.
They are frustrated by new spending proposals the Democrats are trying to push through without Republican support, and Mr McConnell tweeted last month that his party would "not facilitate another reckless, partisan taxing and spending spree".
Speaking after the vote, the Democrats' Senate Majority leader Chuck Schumer said Republicans had "played a dangerous and risky partisan game".
"What is needed now is a long-term solution so we don't go through this risky drama every few months," he added.
But several senior Republicans attacked Mr McConnell's decision to strike a deal with Mr Schumer. South Carolina Senator Lindsey Graham called the move "a complete capitulation".
US lawmakers will still have to address this issue near the new December deadline to avert a default.
If the US defaults on debts, experts say it will severely hurt the country's credit rating, plunge the global financial system into turmoil, and possibly lead to a self-inflicted recession.
What is the debt ceiling?
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 could 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 about new Democrat spending proposals.
Democrats have pointed out that raising the debt ceiling is about paying off existing obligations rather than paying for new ones, and that President Biden's policies have only contributed to 3% of existing debts.