President Trump Donald John TrumpBubba Wallace to be driver of Michael Jordan, Denny Hamlin NASCAR team Graham: GOP will confirm Trump's Supreme Court nominee before the election Southwest Airlines, unions call for six-month extension of government aid MORE on Friday signed a $1.3 trillion omnibus spending bill, averting a government shutdown just hours after he created drama and uncertainty by threatening a veto.

Trump blasted the measure as “ridiculous,” in large part because it contained only a fraction of the money he asked for a wall along the Mexican border and did not include a fix for young immigrants covered by the Deferred Action for Childhood Arrivals (DACA) program he spiked last year.

ADVERTISEMENT

But the president begrudgingly signed the bill, citing the reversal of military spending cuts that he said put the nation “at really grave risk.”

“There are a lot of things that I’m unhappy about in this bill. There are a lot of things that we shouldn't have had in this bill. But we were, in a sense, forced to if we want to build our military,” the president said during an impromptu event at the White House.

“My highest duty is to keep America safe,” he added. “Nothing more important.”

Trump, who has frequently been frustrated in working with Congress on spending bills and has surprised Democrats and Republicans alike with some of his tactics, vowed that he would not sign a similar bill going forward.

“I say to Congress, I will never sign another bill like this again,” he said. “I'm not going to do it again. Nobody read it. It’s only hours old. Some people don't even know what’s in it.”

The president called on Congress to give him the power to make line-item vetoes on all government spending bills and called on the Senate to end its filibuster rule to make it easier to implement the Republican agenda.

The bill signing came just hours after Trump stunned many in Washington by threatening to veto the measure.

If Trump had vetoed the bill, it would almost certainly have led to a government shutdown at midnight.

With lawmakers leaving the nation’s capital on Friday morning for a two-week recess, Trump that DACA recipients were “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.”

The comments undercut guarantees from his own staff, who said he would sign it all along.

“Let’s cut right to the chase. Is the president going to sign the bill? The answer is yes,” White House budget director Mick Mulvaney Mick MulvaneyMick Mulvaney to start hedge fund Fauci says positive White House task force reports don't always match what he hears on the ground Bottom line MORE said Thursday.

Following the tweet, a White House official said Trump would sign the bill and told The Hill that the president wanted to add some “drama"” to the day.

Trump insisted that he “looked very seriously at the veto,” but told reporters that infusion of cash to the military “overrode any of our thinking.”

Defense Secretary James Mattis James Norman MattisBiden courts veterans amid fallout from Trump military controversies Trump says he wanted to take out Syria's Assad but Mattis opposed it Gary Cohn: 'I haven't made up my mind' on vote for president in November MORE, who was at Trump’s side for the announcement, reportedly met with the president on Friday to persuade him to sign the bill because of the boost in funding to the Pentagon.

In threatening a veto, the president had appeared to have been swayed by conservatives who ripped the legislation for adding to the debt.

They have also criticized a process that saw lawmakers approve the bill within 24 hours of its release — a timeline that left little time to read the bill.

House Freedom Caucus Chairman Mark Meadows Mark Randall MeadowsSouthwest Airlines, unions call for six-month extension of government aid Airline CEOs plead with Washington as layoffs loom Trump reacts to Ginsburg's death: 'An amazing woman who led an amazing life' MORE (R-N.C.) tweeted that the group would “fully support” a veto, asking the president to “negotiate a better deal for the forgotten men and women of America.”

Sen. Bob Corker Robert (Bob) Phillips CorkerHas Congress captured Russia policy? Tennessee primary battle turns nasty for Republicans Cheney clashes with Trump MORE (R-Tenn.) also urged the president to nix the omnibus.

“Please do, Mr. President,” he wrote on Twitter. “I am just down the street and will bring you a pen. The spending levels without any offsets are grotesque, throwing all of our children under the bus. Totally irresponsible.”

But Trump ultimately decided to prevent another government shutdown, a scenario members of both parties also wanted to avoid.

The Senate sent the bill to Trump’s desk early Friday morning on a bipartisan, 65-32 vote hours after the House approved the measure. The bill funds the government through the end of September.

The president, however, struggled to overcome his frustration that the bill contained just $1.6 billion for his long-promised border wall. Trump had asked for $25 billion over 10 years to fund the structure as part of a broader immigration deal that would have also addressed DACA recipients.

The president floated a plan that would offer them a pathway to citizenship in exchange for the border wall money and changes to the legal immigration system, but Congress rejected it.

“I do want the Hispanic community to know and DACA recipients to know that Republicans are much more on your side than the Democrats, who are using you for their own purposes,” Trump said.

The president announced last fall he was cancelling the Obama-era DACA program, which offers deportation reprieves and work permits for roughly 800,000 young immigrants brought to the U.S. illegally as children.

A federal judge blocked Trump’s order, meaning the program still remains in place.

This story was updated at 3:18 p.m.