President Donald Trump signed the massive $1.3 trillion funding bill on Friday.

In an earlier tweet, Trump threatened to veto the bill.

If Trump had vetoed the bill, the government would have almost certainly shut down at midnight.

A visibly frustrated President Donald Trump signed the massive $1.3 trillion spending bill into law Friday despite threating to veto the bill just hours earlier.

In a statement at the White House, Trump blasted the process that brought the bill to his desk, calling it a "ridiculous situation that took place over the last week."

"There are a lot of things that I am unhappy about in this bill — there are a lot of things we shouldn't have been in this bill," Trump said. "But I say to Congress: I will never sign another bill like this again. I'm not going to do it again."

Standing next to a copy of the 2,232-page bill, Trump lambasted leaders for forcing the legislation through in such a short amount of time. The bill was released on Wednesday night and passed on Thursday.

"Nobody read it. It's only hours old. Some people don't even know what's in it," Trump said.

Trump stunned the political world early Friday when he publicly mused on Twitter about vetoing the legislation. His top advisers had said on Thursday that he planned to sign it.

The federal government would have almost certainly shut down at midnight had Trump followed through on that threat.

Trump wants changes after his anger toward the bill burst into the open

In addition to attacking the current bill, Trump demanded Congress make additional changes to ensure similar legislation wouldn't make it to his desk in the future.

Trump said he wanted Congress to eliminate the legislative filibuster — a move Senate Majority Leader Mitch McConnell opposes — as well as to give him the power to line-item veto spending bills, which would give him the ability to veto some aspects without vetoing the whole piece of legislation.

Because the Supreme Court found line-item vetoes unconstitutional after Congress gave President Bill Clinton the power in 1996, Congress would most likely need to amend the Constitution to allow such a scenario with Trump.

In his tweet Friday morning, Trump decried the lack of funding for his promised wall along the US-Mexico border.

"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 tweeted.

The omnibus bill includes $1.6 billion in new funding for border security but allows only for fencing similar to what already exists along the border — nothing that would resemble Trump's envisioned wall.

Additionally, the bill does not include a codification of the Deferred Action for Childhood Arrivals immigration program.

The program protects from deportation nearly 700,000 unauthorized immigrants who came to the US as children. Trump ended the program in September but gave Congress a March 5 deadline to pass a law codifying protections for DACA recipients. A federal judge recently blocked the Trump administration from ending the program.

Talks over a deal fell apart Tuesday after the Trump administration offered only a three-year extension of protections for DACA recipients rather than a path to citizenship for the roughly 1.8 million people who qualify for the program.

In exchange for the full DACA protections, Democrats were reportedly set to give Trump the $25 billion the administration requested for the wall.

Members of the administration had praised the bipartisan omnibus bill, which provides funding for everything from the military to low-income housing.

"The president supports the bill, looks forward to signing it," Mick Mulvaney, the White House budget director, said Thursday.

"This omnibus bill, the priorities that are being funded here, are going on the heels of the president's fiscal and economic accomplishments," Kellyanne Conway, a counselor to the president, told Fox News just minutes before Trump's tweet early Friday.