President Trump speaks while participating in a tour of U.S.-Mexico border wall prototypes near the Otay Mesa Port of Entry in San Diego on March 13. (Kevin Lamarque/Reuters)

President Trump has long promoted and promised a “big, beautiful wall” along the southern border — a pledge he made at the start of his presidential campaign that helped fuel his unlikely rise to the White House.

On Wednesday, Trump lost his best chance yet to secure funding for that promise and he won’t get another one for a long time.

Despite a last-minute flurry of offers between the administration and congressional leadership, the massive spending bill finalized Wednesday includes no major boost for a wall along the U.S.-Mexico border and no protections for “dreamers” — young undocumented immigrants whom Trump once said he would treat “with heart.”

In the $1.3 trillion spending bill, Trump will secure about $1.6 billion in funding for barriers along the border, which White House press secretary Sarah Huckabee Sanders touted as a win but is nonetheless far short of the $25 billion the administration had sought for Trump’s wall construction.

Democrats were prepared to give Trump the funding he wanted despite their stiff opposition to a wall, but Trump wasn’t willing to compromise more on the fate of dreamers, leaving it unlikely either issue will be addressed anytime soon.

“He would’ve actually fulfilled one of his goals, even though I abhor that goal,” Sen. Robert Menendez (D-N.J.) said of Trump. “He would have solved a major immigration question that’s going to tug at his administration moving in the days ahead.”

The 2,232-page spending measure will almost surely be the last major bill to clear Congress this year and with it will go the best chance for Trump to get wall funding and for Congress to enact legislative protections for young undocumented immigrants brought to the country as children who had been granted reprieves from deportation under an Obama-era directive. Trump announced in September he would end that program, known as Deferred Action for Childhood Arrivals, by March 5.

But that deadline was effectively nullified by recent court actions, including last month’s decision from the Supreme Court to not review a district court injunction that had forced the administration to continue the DACA program. That lifted much of the pressure to act expeditiously from Congress, which often struggles to legislate unless lawmakers are facing an imminent crisis.

“We have dreamers that need to be taken care of,” said Sen. Jeff Flake (R-Ariz.), who argued the administration should have made a concession on DACA in exchange for more border wall funding. “It’s the way for the White House to get what it wanted on the border.”

Trump himself made a last-minute push for a DACA deal in recent days, reviving immigration discussions that had largely been dormant since a Senate floor fight fizzled in February. The White House pitched $25 billion in border wall funding and three years of protections for current DACA permit holders, an estimated 690,000 young immigrants who had enrolled in the nearly six-year-old program.

But Democrats rebuffed the offer, declining to agree to any temporary extension of DACA permits for only the current program enrollees. Democratic leadership countered with a plan to pair the $25 billion in border wall cash and a pathway to citizenship for a broader dreamer population of about 1.8 million immigrants.

The administration rejected that approach, too. Trump was willing to accept a pathway to citizenship for the expansive pool of dreamers if he secured other significant immigration changes, not solely for the wall, one senior White House official said. 

Those reforms include limiting family-based migration to spouses and minor children and eliminating a visa lottery for countries with fewer immigrants to the United States — two sections of Trump’s so-called “four pillars” plan, which has struggled to gain traction in Congress. Internal GOP politics would complicate the prospects of permanent protections for the young immigrants; a path to citizenship is “something that a lot of Republicans felt great anxiety about,” the official said. 

Undeterred after Democrats declined his first pitch, Trump continued to prod top Republicans on Capitol Hill in recent days for some configuration of a wall-for-DACA deal. He asked for three years of wall funding and three years of DACA protections, paired with other enforcement elements, including some boost in federal enforcement agents and detention beds in the omnibus measure. 

Again, the president was denied.

Early Thursday, Trump lashed out at Democrats.

“Democrats refused to take care of DACA,” he tweeted. “Would have been so easy, but they just didn’t care. I had to fight for Military and start of Wall.”

Yet Democrats say it’s the Trump administration that’s being unreasonable. 

“They just keep pushing for things that we can’t agree to,” insisted Sen. Richard J. Durbin (Ill.), Senate Democrats’ point person on immigration policy. 

Frustrated with the tentative deal, Trump spent the snowy Wednesday venting that he had won just a fraction of funding for the border wall — concerns significant enough that House Speaker Paul D. Ryan (R-Wis.) made a last-minute visit to the White House to lock down Trump’s support for the spending bill. 

Trump’s allies on Capitol Hill were sympathetic to the president’s irritation, particularly because he had campaigned for the border wall so vigorously as a presidential candidate.

“I know he wants to get this done. He thinks he can get a lot of it done in the first year,” said Sen. David Perdue (R-Ga.). The $1.6 billion “doesn’t get you very far.”

Not far at all, especially given that the bill specifically says border funding is only permitted for “operationally effective designs deployed” as of May 5, 2017, “such as currently deployed steel board designs, that prioritize agent safety.” That means the money cannot be used to build any of the wall prototypes that Trump viewed during a high-profile visit on the border on March 13.

Veteran immigration advocates say Trump hamstrung himself by insisting, for months, on provisions that couldn’t attract enough support on Capitol Hill.

Legislation modeled from the administration’s immigration plan won just 39 votes, all Republicans, in the Senate last month. It was by far the least popular among the proposals put up for votes, although none secured the support of 60 senators needed to advance most bills in the chamber. 

“President Trump had an opportunity to deliver on two promises. One, build the wall. Two, to sign a ‘bill of love’ for dreamers. His desire to slash legal immigration and increase immigration enforcement makes delivering on these promises impossible,” said Ali Noorani, the executive director of the National Immigration Forum. “To put it another way: Trump had two birds in hand; now he’s got nothing.”

The immigration stalemate in Washington has languished for at least a generation, yet Trump’s decision to wind down DACA offered perhaps the best chance in years for lawmakers to clinch an agreement. The GOP’s thumping in the 2012 presidential elections by Latino voters spurred the Senate to pass a sweeping immigration overhaul in 2013, but that bill was ignored by the House.

Democrats have undergone their own evolution when it comes to Trump’s prized wall. After mocking it for the better part of Trump’s presidential campaign and his first year in office, congressional Democrats recently begrudgingly endorsed a massive infusion of cash for the proposal.

Doing so prompted backlash from some immigration advocates who believe Democrats too readily gave in on a wall. But for their part, Democratic lawmakers say permanent protections for dreamers facing imminent limbo — not to mention the political makeup of Washington — made them more willing to accept what was once anathema to them.

“Elections have consequences. Right?” Menendez said. “When Republicans control everything and you have a White House that is the most anti-immigrant White House I’ve ever seen that at the end of the day, you have to take some tough choices.”

Sensing an opening in the final days of haggling over the spending bill, the influential network of conservative groups funded by billionaire industrialists Charles and David Koch made a last-minute push to persuade the White House and congressional Republicans to take what the Democrats had initially offered. A leader of one of the Koch-affiliated groups, Daniel Garza of the LIBRE Initiative, said the organizations made the push because the omnibus was the “last train leaving the station.” 

But when the legislation was ultimately released, there would be no dreamer protections, no dramatic boost in wall funding and no major changes to immigration policy. It would be unclear the next time Trump would get a shot at fulfilling a campaign pledge. 

“Trump blew it; he got greedy and now he probably will not get his wall,” said Kevin Appleby, senior director of international migration policy at the Center for Migration Studies. “Thank goodness.”

Erica Werner contributed to this report.