Despite President Trump’s threats to shut down the government this month to win border-wall funding, there appears to be little appetite in Washington for a compromise deal that has been viewed as a potential win for both political parties.

Trump and Democratic leaders are rejecting talk of a grand bargain on immigration that would provide $25 billion for the wall at the U.S.-Mexico border in exchange for permanent legal status, and possible citizenship, for up to 1.7 million young undocumented immigrants known as “dreamers.”

That plan was reportedly on the table in January before the White House derailed the talks by insisting on additional concessions, including slashing legal immigration and speeding up deportations.

Asked by reporters Thursday whether House Democrats would be interested in the original deal, possible incoming Speaker Nancy Pelosi (Calif.) bluntly replied: “No.” The wall money and the dreamers “are two different subjects,” she said.

Pelosi isn’t the only one squelching hopes for an immigration breakthrough. Trump signaled recently that he is in no mood to deal. Rather, he is looking to the spring — when the Supreme Court could rule on his administration’s blocked attempts to unwind an Obama-era work program for dreamers — to win greater leverage in negotiations over their future.

“If the court rules properly . . . we’ll get everything solved,” Trump told Politico last month, suggesting Democrats would have more urgency to accede to his demands.

For their part, the dreamers have made clear to Democrats that they should recognize they have the upper hand at a time when the party is ascendant. Given the administration’s hard-line enforcement actions — separating immigrant families and sending military troops to the border — advocates are refusing to cede ground to the White House.

“We stand true to our position that we should not be used as bargaining chips . . . to give more money” to the Trump administration, said Greisa Martinez, deputy executive director at United We Dream, an advocacy group for immigrants who have lived in the country illegally since they were children.

The hardening positions have contributed to uncertainty over how the budget fight will be resolved and threaten to divide both parties on a hot-button political issue entering the 2020 campaign cycle.

The Senate has approved a spending bill that would allocate $1.6 billion to border security upgrades, while Trump has favored a House plan that includes $5 billion. This week, Trump upped the ante, declaring in a tweet that “Top Border Security, including a Wall, is $25 Billion.”

“Get it done!” he wrote.

Looking into next year, the number of House Republicans who might be likely to support a compromise also has gotten smaller: As many as 14 of the 23 Republicans who signed onto a procedural move last spring to force an immigration vote are either retiring or were defeated last month.

Immigration reformers said the situation highlights a chief obstacle that has created a legislative stalemate for decades, as hard-liners on both sides hold firm to all-or-nothing strategies based on electoral politics.

“We’ll never get a deal under the ‘elections have consequences’ rubric of where you have to come to my side and give me everything I want,” said Leon Fresco, who served as a Democratic Senate aide during 2013 immigration talks in Congress that ultimately collapsed. “You should bargain under what you think is a fair deal that would survive any electoral configuration.”

Independent voices have called on Congress to do the deal ahead of the Dec. 21 deadline for a new spending bill. Donald E. Graham, the former publisher of The Washington Post who founded a scholarship program for dreamers, warned about the uncertain future facing 700,000 of them who have work permits under the Deferred Action for Childhood Arrivals (DACA), an Obama administration program that started in 2012.

A compromise “would give each party something it badly wants,” Graham wrote in a Post op-ed last month. “Do it, Congress. Do it now.”

Privately, some members of both parties say a deal makes sense. The prospect of thousands of dreamers losing their jobs if the Supreme Court sides with the Trump administration would thrust an emotionally fraught and unpredictable issue into the center of the emerging presidential campaign.

But in public, both sides are refusing to budge from their hard-line positions.

Pelosi said her top governing priorities include a bill to protect dreamers, but it would not include border enforcement resources. One Democratic aide in the House said liberal members “want us to do a big, clean bill” that is unlikely to succeed.

This segment of the party believes “we are not going to get anything under Trump, so let’s stand for something,” said the aide, who spoke on the condition of anonymity because they were not authorized to speak on the record. “But when we are saying that, it’s really hard for other members to do something short of that.”

Some Democrats pointed to the collapse of immigration talks in January as evidence Trump cannot be trusted. After the president signaled interest in a bipartisan proposal from Sens. Richard J. Durbin (D-Ill.) and Lindsey O. Graham (R-S.C.) that included wall funding and legalization for dreamers, the White House reversed course and rejected it amid a revolt from Trump’s conservative base.

“The wall money is important to him, but it’s not just Trump we’re working with,” said Lorella Praeli, deputy national political director of the American Civil Liberties Union. “It’s not a question of, ‘Let’s find Trump on a good day and try to, in good faith, negotiate a deal.’ He has xenophobic and anti-immigration tendencies, but he’s also surrounded by a world of people who do.”

Trump has professed empathy for the dreamers, but in Sept. 2017, his administration declared that DACA was unconstitutional and announced plans to end it. Federal courts blocked those plans, however, and the Justice Department has asked the Supreme Court to take up the case in the spring.

In a recent interview with The Post, Trump said the court proceedings blocked momentum for a legislative deal. He appeared to be suggesting that Democrats would have agreed to his terms had the dreamers begun to lose their protected status, although there is no evidence that the two sides were negotiating in recent months.

Conservative border hawks have pressured the White House to hold its ground.

“President Trump should not entertain a deal on DACA until the Supreme Court rules next year,” said RJ Hauman, government relations director at the Federation for American Immigration Reform, which advocates for lower immigration levels.

His group is one of several conservative organizations that are calling for deep cuts to legal immigration levels, which some Trump advisers, including Stephen Miller, insist should be part of any deal with Congress.

Meantime, the ranks of moderate GOP voices on immigration are thinning. Of the 23 House Republicans who signed onto a failed procedural move to force an immigration overhaul vote in the spring, it appears likely that 14 will not return to Congress in 2019.

A compromise deal would be a mistake, Hauman added, because construction of the wall would be delayed by legal challenges, while the dreamers’ transition to full legal status would send a message that the United States rewards illegal immigration.

“How is that a good deal for the president?” he said. “And more importantly, how does that stop future illegal immigration?”