President Trump, who signed a $1.3 trillion spending bill last week, is frustrated with the amount Congress provided to finance a U.S.-Mexico border wall and is pressing to use money dedicated to the military. (Mark Wilson/Getty Images)

President Trump, who repeatedly insisted during the 2016 campaign that Mexico would pay for a wall along the southern border, is privately pushing the U.S. military to fund construction of his signature project.

Trump has told advisers that he was spurned in a large spending bill last week when lawmakers appropriated only $1.6 billion for the border wall. He has suggested to Defense Secretary Jim Mattis and congressional leaders that the Pentagon could fund the sprawling project, citing a “national security” risk.

After floating the notion to several advisers last week, Trump told House Speaker Paul D. Ryan (R-Wis.) that the military should pay for the wall, according to three people familiar with the meeting last Wednesday in the White House residence. Ryan offered little ­reaction to the idea, these people said, but senior Capitol Hill officials later said it was an unlikely prospect.

The president’s pursuit of defense dollars to finance the U.S.-Mexico border wall underscores his determination to fulfill a campaign promise and build the barrier despite resistance in the Republican-led Congress. The administration’s last-minute negotiations with lawmakers to secure billions more for the wall failed, and Trump grudgingly signed the spending bill Friday after a short-lived veto threat.

Four days later, Trump continued to express regret over signing the $1.3 trillion package, which funded the government and averted a shutdown, saying it was a mistake and he should have followed his instincts.

In another interaction with senior aides last week, Trump noted that the Defense Department was getting so much ­money as part of the spending bill that the Pentagon could surely afford the border wall, two White House officials said. The Pentagon received about $700 billion in the spending package, which Trump repeatedly lauded as “historic.” 

Meanwhile, the $1.6 billion in the bill for some fencing and levees on the border not only fell far short of the $25 billion that Trump was seeking, but it also came with tight restrictions on how the money could be spent. 

The individuals and officials spoke on the condition of anonymity to talk freely about private discussions.

White House press secretary Sarah Huckabee Sanders deflected a question Tuesday about money dedicated to the military being used to fund construction of the wall.

“I can’t get into the specifics of that at this point, but I can tell you that the continuation of building the wall is ongoing, and we’re going to continue moving forward in that process,” Sanders told reporters.

“Build WALL through M!” Trump recently wrote on Twitter. He retweeted those words Tuesday, noting that “our Military is again rich.” Two advisers said “M” stood for “military.”

The president has suggested to Mattis that his department, instead of the Department of Homeland Security, could fund the construction, two Trump advisers said. But the military is not likely to fund the wall, according to White House and Defense Department officials. 

The Pentagon has plenty of money, but reprogramming it for a wall would require votes in Congress that the president does not seem to have. Taking money from the 2018 budget for the wall would require an act of Congress, a senior Pentagon official said.

To find the money in the 2019 defense budget, Trump would have to submit a budget amendment that would require 60 votes in the Senate, the official said.

Democrats in Congress would probably chafe at military spending going to the construction of a border wall, and military officials may also blanch, White House advisers said.

Defense hawks in the Republican ranks would balk at taking money now dedicated to the Pentagon for aircraft, weapons and improvements to the armed forces’ readiness and instead steering it toward construction of the wall.

“First Mexico was supposed to pay for it, then U.S. taxpayers, and now our men and women in uniform?” Senate Minority Leader Charles E. Schumer (D-N.Y.) said in a statement to The Washington Post. “This would be a blatant misuse of military funds and tied up in court for years. Secretary Mattis ought not bother and instead use the money to help our troops, rather than advance the president’s political fantasies.” 

Trump has grown frustrated watching constant TV criticism of the spending package and is determined to find a new way to fund the wall, several advisers said, privately grousing that his political supporters could become disenchanted without progress. After a recent trip to see prototypes of the wall in California, Trump has grown more animated by the issue, advisers said. 

The president’s comments raising the possibility of using Pentagon funds to build the wall came after the collapse of negotiations with Democrats to secure $25 billion in long-term wall funding in exchange for protections for young immigrants at risk for deportation because of Trump’s cancellation of the Deferred Action for Childhood Arrivals program. 

The White House offered three years of protections for DACA recipients, according to multiple congressional aides, but Democrats demanded ­pro­tections for a larger group of “dreamers,” including those who never applied or are ineligible for DACA. The negotiations fell apart before the spending bill was drafted and passed last week.

The urgency to strike a deal reflected the growing sense that the spending bill represented the last chance for the Trump administration to secure substantial wall funding, at least in the president’s first term. Top Republicans believe it is all but certain that Democrats will gain House seats in November’s midterm elections — and perhaps take the majority — greatly enhancing their bargaining position in future spending negotiations.

Only $641 million is earmarked for new primary fencing in areas that have no barriers, and most of the money can be spent only on “operationally effective designs” that were deployed as of last May. That means the prototype designs the Trump administration is exploring cannot be built, except along a stretch of the border near San Diego where a barrier is already in place.

Greg Jaffe contributed to this report.