The US Congress ended a brief government shutdown by reaching a wide-ranging deal that is expected to push budget deficits into the $US1 ($A1.4) trillion-a-year zone.
The bill passed in the Senate and survived a rebellion of 67 conservative Republicans in the House of Representatives thanks to the support of some Democrats.
Those conservatives were mainly angry about non-military spending increases.
President Donald Trump signed the measure into law on Friday morning, ending a government shutdown that began just after midnight, when Congress was still debating the budget deal.
Trump tweeted: "Without more Republicans in Congress, we were forced to increase spending on things we do not like or want in order to finally, after many years of depletion, take care of our Military.
"Our Military will now be stronger than ever before. We love and need our Military and gave them everything - and more. First time this has happened in a long time. Also means JOBS, JOBS, JOBS!"
Trump also wrote that negotiations will "start now!" on an immigration measure that he and Democrats have been battling over for months.
It was the second shutdown this year under the Republican-controlled Congress.
The deal is the fifth temporary government funding measure for the fiscal year that began on October 1 and replenishes federal coffers until March 23, giving lawmakers more time to write a full-year budget.
It also extends the US government's borrowing authority until March 2019, sparing Washington politicians difficult votes on debt and deficits until after mid-term congressional elections in November.
Once known as the party of fiscal conservatives, the Republicans and Trump are now quickly expanding the US budget deficit and its $20 trillion national debt.
Their sweeping tax overhaul bill approved in December will add an estimated $1.5 trillion to the national debt over 10 years.
Friday's deal allows for $165 billion in additional defence spending over two years that will help Trump deliver on his promise to rebuild the military.
That won over many Republicans but some were still furious over the $131 billion extra made available for non-military spending, including health and infrastructure.
None of the added spending will be offset by budget savings elsewhere or revenue increases, relying instead on government borrowing.
There also is no offset reduction for nearly $90 billion in new disaster aid for US states and territories ravaged by hurricanes or wildfires.
Australian Associated Press