Washington CNN  — 

President Donald Trump signed the $1.3 trillion spending bill to keep the federal government open Friday behind closed doors, then emerged to excoriate Congress for passing the legislation in the first place.

Trump cited misgivings about its contents, but said he agreed to sign the bill to deliver a boost in defense spending – repeatedly casting the decision as one in which he had “no choice.”

“There are a lot of things 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 if we want to build our military,” Trump said. “I said to Congress, I will never sign another bill like this again.”

Trump lamented the “ridiculous situation that took place over the last week,” pointing out that lawmakers had little time to read through the 2,232-page document, and grumbled about the high price tag, but cited few specific provisions he opposed.

Instead, he vented his frustrations about the compromise-riddled legislation that is largely a product of the narrow Republican majority in Congress and called on the Senate to eliminate the filibuster that requires a 60-vote majority.

“Without the filibuster rule it’ll happen just like magic,” Trump said.

He also called on Congress to give him “line-item veto” powers for all government spending bills, which the US Supreme Court ruled unconstitutional in 1998.

RELATED: Congress moves to block border wall in key wildlife refuge

Veto threat

Trump signed the legislation just hours after he once again sent Washington into a frenzy after threatening to veto the legislation because it does not include a solution for recipients of the Deferred Action for Childhood Arrivals program or sufficient funding for a border wall.

Just before 9 a.m. Friday, Trump tweeted that he was “considering a VETO of the Omnibus Spending Bill,” which some conservatives spent the morning railing against on one of the President’s favorite TV shows, “Fox and Friends.”

“We looked at a veto, I looked very seriously at the veto. I was thinking about doing the veto, but because of the incredible gains we’ve been able to make for the military, that overrode any of our thinking,” Trump said after signing the bill.

While the bill delivered $1.6 billion in border security funding, some of which can be used to bolster existing fencing, Trump made no secret of his dismay that the bill did not include funding for the border wall he has long sought to build.

The White House and Republican lawmakers and sought to strike a deal with Democrats that would have included border wall funding and provide legal status or citizenship for DACA recipients, but a deal has remained elusive.

Friday, Trump argued that Democrats have stood in the way of DACA recipients gaining permanent legal status, while casting Republicans as would-be saviors.

“The Republicans are with you, they want to get your situation taken care of,” Trump said, speaking directly to DACA recipients. “The Democrats fought us, they just fought every single inch of the way. They did not want DACA in this bill.”

Democrats have rejected White House-backed plans because they would either provide only a temporary solution or include other hardline legal immigration reforms. And the DACA program is expiring because Trump moved to end the Obama-era program last year.

But Trump sought to use the political gridlock to his advantage, casting Republicans as the true defenders of the subset of undocumented immigrants – who are protected by a program that Trump ended.

“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 purposes,” Trump said.

The massive spending package marks the end of a months-long funding stalemate in which lawmakers were forced to pass one short-term spending bill after another to stave off a shutdown.

The package includes more than just money to fight the opioid epidemic, pay the military and fund more than $21 billion in infrastructure projects. It also includes policy changes like one that would incentivize states to enter more records into the country’s gun background check system and another that would cut off aid to the Palestinian Authority until Palestinians cease making payments to the families of terrorists.

Spotted in the West Wing on Friday by CNN shortly after Trump’s tweet, Marc Short, the White House legislative affairs director, struck an assured tone when asked if the government would shut down over Trump’s veto threat.

“I think we’ll be OK,” he said.

Just a few hours later, Trump signed the measure.

CNN’s Allison Malloy contributed to this report.