President Joe Biden has said raising the US borrowing limit averted “economic collapse”, in his first Oval Office address to the nation on Friday.
He signed the bill into law on Saturday after it cruised through Congress with bipartisan support.
The Democratic president voiced rare praise for his Republican counterparts, saying they “operated in good faith”.
He said a US default on its $31.4tn (£25tn) debt by Monday’s deadline would have been “catastrophic”.
Speeches to the nation from the Oval Office are typically reserved for major crises, such as war or natural disasters.
The White House said Mr Biden’s decision to make his remarks there underscored the gravity of the situation if the debt ceiling had not been raised at the last minute.
For weeks the White House and Republicans debated details of a deal, and there was scepticism about whether the package would actually be finalised before the US government ran out of money on 5 June.
The bill passed 63-36 in the Senate on Thursday night, a day after it easily cleared the House of Representatives.
The president praised congressional leaders, including Republican Speaker of the House Kevin McCarthy and Republican Senate leader Mitch McConnell.
“They acted responsibly, and put the good of the country ahead of politics,” said Mr Biden, who is running for re-election in 2024.
The deal suspends the debt limit until 1 January 2025 and caps non-defence spending, while expanding work requirements for food and healthcare assistance, amongst other provisions.
Full funding for the medical care of military veterans would also increase, in line with what President Biden had sought.
The legislation will result in $1.5tn in savings over a decade, the independent Congressional Budget Office said on Tuesday.
Though it was largely a bipartisan bill, there were Republicans who said the deal did not go far enough with cuts while some Democrats said it went too far.
Source : BBC