US President Donald Trump signed congress’ $US1.3 trillion ($A1.68 trillion) spending bill, ending several hours of confusion after he tweeted a threat to veto it, raising the spectre of a government shutdown.

Trump said he had signed the bill despite his qualms on some issues, because a $US60 billion increase in military spending had convinced him it was a worthwhile compromise.

‘But I say to congress I will never sign another bill like this again,’ he told reporters on Friday. ‘I’m not going to do it again.’

White House and Capitol Hill aides had been left scrambling earlier in the day after Trump criticised the six-month spending bill despite prior assurances from the administration that he would sign it ahead of a looming midnight deadline.

‘I am considering a VETO of the Omnibus Spending Bill based on the fact that the 800,000 plus DACA recipients have been totally abandoned by the Democrats (not even mentioned in Bill) and the BORDER WALL, which is desperately needed for our National Defense, is not fully funded,’ Trump wrote on Twitter at 9am local time.

But by early afternoon, he appeared before reporters in the Diplomatic Reception Room of the White House to announce he had signed the measure.

‘There are a lot of things I’m unhappy about in this bill,’ he said, patting the more than 2000 pages of the legislation stacked on a purple box beside him.

It was unclear how seriously Republican leaders took Trump’s shutdown threat. Neither Speaker Paul Ryan nor Senate Leader Mitch McConnell commented publicly on it.

Lawmakers in the Republican-dominated Senate and House of Representatives had already left Washington for a scheduled two-week spring recess, and Trump himself was scheduled on Friday to fly to Florida for a weekend at his private resort.

Trump has been frustrated that congress has not turned over funding to make good on his campaign promise to build a wall along the US-Mexico border. The bill includes $US1.6 billion for six months of work on the project but he had sought $US25 billion for it.

Trump also has been at odds with Democrats in congress over the fate of Dreamer immigrants, those brought to the US illegally when they were children.

Trump cancelled the Deferred Action for Childhood Arrivals program that gives work permits to the Dreamers and protects them from deportation. The decision is currently tied up in court cases.

He offered to extend the protections, tied to a sweeping set of changes to immigration laws, but subsequently rejected bipartisan offers from lawmakers.

As the six-month spending budget deal was coming together, there had been reports Trump had baulked at the bill and had to be persuaded by Ryan to support it.

The conservative wing of Trump’s party had panned the bill because of its spending increases and some deficit hawks cheered Trump’s Friday morning threat to veto it.