The bill passed the House of Representatives on Wednesday and now goes to Obama for the formalities of his signature, although the political fallout looks set to linger on.
The measure, which passed 64 votes to 35 late into the night, provides lawmakers with some fiscal breathing room through the 2016 presidential election after years of bruising spending fights.
The plan suspends the statutory federal borrowing cap until mid-March 2017 and averts a damaging default.
It also adds USD 31 billion into an emergency war fund for the Pentagon, offset by tweaks to entitlement programs including Social Security.
More From This Section
The deal is the result of weeks of secret negotiations between the White House and Republican then-speaker John Boehner, who sought to clear the decks of any fiscal crises before his successor took the gavel.
Boehner stepped down Thursday, when congressman Paul Ryan was elected as the new speaker of the House, and the bill marked Boehner's final legislative achievement.
The Republican-controlled Congress must raise the federal borrowing limit by November 3, or risk Washington ending up in default.
Senate Minority Leader Harry Reid praised lawmakers for coming together to pass the bill, which he said "will help prevent a government shutdown and avoid a disastrous default on our nation's obligations."
Overall, the new budget would set 2016 discretionary spending at USD 1.067 trillion, of which about half is for defense. The figure would rise slightly in 2017, to USD 1.071 trillion.
Congressional appropriators will need to decide how the funds will be divided among the vast slate of federal programs by December 11, when a stopgap spending measure expires.