The US Senate voted in favor of a bipartisan deal to suspend the government's $31.4 trillion (€29.4 trillion) debt ceiling on Thursday.
The Senate approved the bill with a vote of 63-36 after months of partisan disagreements between Democrats and Republicans.
It comes just days before a deadline to avert a potential default that could have a devastating effect on the US economy.
The bill now goes to US President Joe Biden to be signed into law.
Biden praised the Congress saying, "This bipartisan agreement is a big win for our economy and the American people."
The president said in a statement that he will sign it into law as soon as possible.
Senate Majority Leader Chuck Schumer said the bill's passage means "America can breathe a sigh of relief." "We are avoiding default," he said.
Earlier, Senate Republican leader Mitch McConnell also expressed his desire to swiftly pass the bill after it received overwhelming approval in the House.
What is in the bill?
Prior to the vote, senators vigorously debated and considered nearly a dozen amendments, ultimately rejecting all of them.
The 99-page bill restricts spending for the next two years, suspends the debt ceiling into January 2025 and changes policies, including new work requirements for older Americans receiving food aid and greenlighting an Appalachian natural gas line that many Democrats oppose.
The bill provides increased funding for defense and veterans while reducing the allocation of new funds for Internal Revenue Service agents.
Additionally, it rejects President Biden's proposal to reverse tax breaks for corporations and the wealthy that were implemented during the Trump era, which were intended to address the nation's deficits.
In the House, the bill passed 314-117 on Wednesday, surviving a rebellion from 71 conservative Republicans who voted no and argued the cuts did not go far enough.
They, ominously, hinted at the possibility of attempting to remove McCarthy from his position over the issue.
On the other side, Democrats had their own grievances. They criticized the new work requirements imposed on Americans aged 50-54 in the food aid program, the alterations made to the influential National Environmental Policy Act, and the approval of the controversial Mountain Valley Pipeline natural gas project, which they argued would hinder efforts to combat climate change.
The bill eventually relied on centrists in both parties to pull through.
Avoiding economic upheaval
While the hard-fought compromise did not satisfy everyone, lawmakers believed it was a preferable alternative to potential economic turmoil both domestically and internationally if Congress failed to take action.
The Congressional Budget Office, a nonpartisan entity, projected that the spending restrictions outlined in the package would lead to a $1.5 trillion reduction in deficits over the course of a decade — a key objective for Republicans aiming to address the national debt.