Donald Trump was criticised by conservatives on Friday as he has signed a "monster" $1.3 trillion spending bill into law, having earlier threatened to veto it.
The 2,232-page bill, which had been passed by Congress, funds the US government through September 30 and averted a government shutdown late on Friday night.
It included large increases in both military and non-defence spending. Mr Trump, who was elected to cut wasteful spending, said he was "very unhappy" with the bill and would never sign another one like it.
The bill, which the most fiscally conservative Republicans in Congress called "grotesque," included only $1.6 billion towards the cost of Mr Trump’s border wall.
At the White House Mr Trump, clearly irritated, said: "As a matter of national security I’ve signed this bill. There’s a lot of things I’m unhappy about in this bill, a lot of things we should have had in it, a lot of things that should not have been in it, but we were forced to if we want our military.
"I said to Congress, I will never sign another bill like this again. I’m not going to do it again. Nobody read it. It’s the second largest ever, President Obama had one larger, I’m sure he wasn’t very happy about it.
"I looked very seriously at the veto but because of the incredible gains we’ve been able to make for the military, that over road it. My highest duty is to keep America safe."
Mr Trump alarmed many in Washington early on Friday by tweeting he was "considering a VETO" of the bill.
His decision to sign it brought to an end months of intense negotiations
The centerpiece of the bill was a big increase in US defence spending to $700 billion, up $61 billion, and a 10 per cent rise in domestic spending, which will go up to $591 billion.
The bill provided $1.6 billion for border security and construction or repair of nearly 100 miles of border fencing, but that was far less than Trump had been seeking.
It leaves intact funding for women’s health provider Planned Parenthood, a target of relentless criticism from pro-life Republicans.
But in a major blow to Democrats it set aside the issue of the so-called "Dreamers" – hundreds of thousands of people who came to the US illegally as children – who are in legal limbo.
The conservative House Freedom Caucus, which voted against the spending bill in the Congress, said they would have supported a presidential veto.
Bob Corker, a Republican senator, said: "The spending levels without any offsets are grotesque, throwing all of our children under the bus. Totally irresponsible."