The US Congress averted a government shutdown just one day before federal funding was due to expire, sending President Donald Trump a bill to provide just enough money to keep agencies operating through January 19.

With lawmakers eager to begin a holiday recess until January 3, the House of Representatives and Senate scurried to pass the hastily written bill by votes of 231-188 and 66-32, respectively.

When Congress returns, lawmakers will immediately have to get back to work on appropriating more money for a fiscal year that already will be three months old. They will try to pass an "omnibus" spending bill to fund the government from January 19 through September 30.

Negotiators have been struggling for months over thorny issues such as the amount of defense-spending increases versus increases for other domestic programs, including medical research, opioid treatment and "anti-terrorism" activities.

Fiscal hawks, meanwhile, are angry that Congress is again moving to bust through spending caps that had been designed to tamp down mounting federal debt.

But some of those same lawmakers in the Republican-controlled Congress earlier in the week voted for a sweeping tax bill that will add $1.5 trillion over the next 10 years to a national debt that already stands at $20 trillion.