President Donald Trump, after wavering, decided to sign a $1.3 trillion omnibus spending bill, asserting his highest duty as president is to “keep America safe.”

Speaking to reporters Friday at the White House, Trump called the massive spending bill “ridiculous.”

“I’m not going to do it again,” he said of signing such an expensive, hastily assembled package.

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

Democrats demanded many concessions from Republicans in exchange for a historic boost in military spending, he said.

Trump called for the Senate to do away with the filibuster rule and allow legislation to pass by a simple 51-vote majority. He also asked Congress to give him a line-item veto.

Surprising lawmakers on both sides of the aisle, Trump had threatened Friday morning to veto the spending bill hours after Congress passed it.

The White House previously had signaled support for the spending package, which has conservative lawmakers up in rhetorical arms. The 2,232-page bill had not been released by Republican congressional leadership until Wednesday night.

“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 Friday morning.

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. — Donald J. Trump (@realDonaldTrump) March 23, 2018

Trump had asked $25 billion to build a wall at the U.S.-Mexico border; the spending bill provides a $1.6 billion down payment to begin construction. The bill also provides a pay raise for the military, boosts other defense spending, and includes language on fighting the opioid crisis and rebuilding infrastructure.

Trump followed up with a tweet proclaiming, “DACA was abandoned by the Democrats. Very unfair to them! Would have been tied to desperately needed Wall.”

DACA was abandoned by the Democrats. Very unfair to them! Would have been tied to desperately needed Wall. — Donald J. Trump (@realDonaldTrump) March 23, 2018

The bill passed the Senate 65-32 and passed the House by a vote of 256-167. That’s short of a two-thirds supermajority to override a presidential veto.

“I say to Congress, I will never sign a bill like this again. I’m not going to do it again,” Trump said shortly after 1 p.m. at the White House. “Nobody read it. It’s only hours old. … You tell me who can read that quickly.”

Still, Trump underlined the importance of national security, and introduced Defense Secretary James Mattis, who thanked Americans for their part in strengthening the military.

“My highest duty is to keep America safe. Nothing more important,” Trump said, adding that the omnibus “reverses” a hollowing-out of military capabilities.

“As a matter of national security I’ve signed this omnibus budget bill,” he said, adding: “There are a lot of things I’m unhappy about in this bill.”

>>> Related: 11 Reactions From Conservatives Unhappy With the Government Spending Bill

Mattis made brief remarks.

“Today we received the largest military budget in history, reversing many years of declined and unpredictable funding,” the defense secretary said. “Together, we are going to make our military stronger than ever.”

“It’s our responsibility in the military to spend every dollar wisely in order to keep the trust and the confidence of the American people and the Congress,” he said.

Had Trump followed through on a veto, the government would have run out of money at midnight, or 12:01 a.m. Saturday, setting up the second partial government “shutdown” of 2018. In January, Senate Minority Leader Charles Schumer, D-N.Y., led a weekend shutdown.

That shutdown also dealt with Democrats’ opposing inaction on continuing the Obama-era Deferred Action for Childhood Arrivals program, to shield from deportation about 800,000 illegal immigrants brought to the country as minors.

Addressing Hispanic Americans, and DACA recipients in particular, Trump said: “Republicans are much more on your side than the Democrats, who are using you for their own purposes.”

White House press secretary Sarah Huckabee Sanders voiced support Wednesday for the omnibus bill, saying Trump was in agreement with House Speaker Paul Ryan, R-Wis., and Senate Majority Leader Mitch McConnell, R-Ky.

“The president had a discussion with Speaker Ryan and Leader McConnell, where they talked about their shared priorities secured in the omnibus spending bill,” Sanders said. “The president and the leaders discussed their support for the bill.”

The White House in its newsletter, “1600 Daily,” said Thursday:

In the coming 36 hours, members of both houses of Congress will vote on an ‘omnibus’ spending bill to keep our federal government open. Omnibus bills cover a broad range of priorities, eliminating the need for many separate votes. President Donald J. Trump supports the deal crafted by leaders on Capitol Hill and urges its swift passage.

The omnibus bill faced significant Republican opposition, especially among conservatives such as members of the House Freedom Caucus.

“Unfortunately, this spending bill is not a product that represents everybody. It’s a product written by a few politicians who got in a room and decided how to spend a trillion dollars,” Sen. David Perdue, R-Ga., said in a written statement. “The result is a massive spending package projected to increase the federal debt by another trillion dollars. This is no way to fund the federal government. While this bill provides our military with more funding, it does not provide them with more certainty in the long-term.”

Two of the president’s most vocal Republican critics said they strongly oppose the spending bill.

Sen. Bob Corker, R-Tenn., tweeted:

Please do, Mr. President. 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. https://t.co/np7BmP1AkB — Senator Bob Corker (@SenBobCorker) March 23, 2018

In a formal statement before the vote, Sen. Ben Sasse, R-Neb., said: “Every Republican would vote against this disgusting pork bill if a Democrat were president. This spending kegger is a wildly irresponsible use of the taxpayers’ money, and the president should not sign it.”

Very little has changed in the spending bill, said Justin Bogie, senior policy analyst for fiscal affairs at The Heritage Foundation.

“We would have rather seen Congress pass a one-week continuing resolution to have time to read, debate, and offer amendments to the 2,000-page bill,” Bogie told The Daily Signal. “It would be very hard to keep the government open if there is a veto.”

Technically, Congress remains in session, but many members already have left town, so salvaging something before midnight Friday isn’t likely, Bogie said.

“I think it’s mostly posturing, and [the president] will probably end up signing it because there is a lot of pressure to approve the military spending increases,” Bogie added.

In a research paper on the bill, Bogie wrote: “Any semblance of the regular order budget process has been ignored in favor of funding by crisis, as Congress has again failed to perform one of its most important functions: oversight.”

Bogie’s analysis continues: