Evan Vucci / AP

Updated on January 16 at 5:09 p.m. ET

The first government shutdown of the Donald Trump presidency has been a long time coming.

It has been eight months since the president, in a tweet of pique during a soon-forgotten spending fight with Democrats, suggested that the country “needs a good ‘shutdown’” to fix its mess. The two parties veered away from the brink then, and they have kept refueling the federal tank a few gallons at a time in the months since.

But for an angry president and an impatient opposition, there may be no way out of the showdown that is building this week. At its core are the competing promises Trump made to his base—to crack down on illegal immigration and build a giant southern border wall—and that many Democrats made to theirs—to protect at any cost the young undocumented immigrants who face possible deportation under a March deadline set by the president.

Government funding runs out Friday at midnight, and the Republicans who hold the majority in Congress will need at least nine Democratic votes in the Senate to defeat a filibuster and keep the lights on. Democrats have demanded that an agreement extending the protections of the Deferred Action for Childhood Arrivals program be at hand before they agree to an interim funding bill. But a deal now seems far off after Trump rejected last week’s bipartisan Senate proposal while denigrating some nations as “shithole countries” and then insulting the Democratic senator, Richard Durbin of Illinois, who called out his comments as racist.

“The Democrats want to shut down the Government over Amnesty for all and Border Security,” Trump tweeted on Tuesday morning, continuing a long series of blustery posts that have treated the prospect of a shutdown as all but inevitable. “The biggest loser will be our rapidly rebuilding Military, at a time we need it more than ever. We need a merit based system of immigration, and we need it now! No more dangerous Lottery.”

The deal that Durbin and five other senators—three Democrats and three Republicans in all—brought to Trump would have offered a lengthy path to citizenship for nearly 700,000 DACA recipients and a renewable legal status to their parents. It reportedly would have provided at least $1.6 billion for Trump’s wall and more for additional border security, and it would have modified family-based immigration and the diversity visa lottery. But Trump wanted more wall funding and broader changes to the legal immigration system.

Kirstjen Nielsen, secretary of the Department of Homeland Security, testified before the Senate Judiciary Committee on Tuesday, and Durbin used her appearance to bring to light the discussion that took place at the White House meeting in which Trump allegedly made vulgar comments. Durbin said Trump demanded an appropriation of $20 billion so that his wall could be constructed in a single year—a sum that is more than 10 times as much as the president requested in his 2018 budget proposal. “The president is insisting on something that is physically, legally impossible,” Durbin said, pointing out that because of likely lawsuits and the complication of construction, a wall couldn’t be built that quickly no matter how much money Congress appropriated.

While dancing around the particular words that Trump used in the meeting, Nielsen confirmed his new funding demand and said the administration was also insisting on policy changes that would make it easier to apprehend and deport undocumented immigrants who might be terrorists or carrying drugs.

“We gave you every penny you asked for,” Durbin said in reference to the bipartisan proposal.

“It’s not the pennies. It’s the loopholes,” Nielsen replied.

Republican and Democratic negotiators are simultaneously working on a long-term spending agreement that will lift caps for the military and domestic agencies. But even if they struck a deal in the next few days, another continuing resolution would be needed to give bill-writers time to draft legislation.

Despite the bleak outlook at the moment, there are a few ways that Congress could avoid a shutdown at week’s end. The simplest, but seemingly least likely, is a DACA deal. Durbin and Senator Lindsey Graham of South Carolina have held out hope that Trump might come around on the agreement they reached, or at least that it might form the basis of a final deal. Durbin is also part of a separate group of the four “Number 2” House and Senate leaders in each party that are expected to resume negotiations. Democratic leaders have said that as long as an agreement is reached with Trump’s support, they would help Republicans keep the government open while the legislation is drafted.

Another possibility is that Senate Democrats blink at the last moment even if no immigration deal is reached. Republican leaders in the House will try to pass a temporary funding bill on their own, and if they do, the onus will be on Democrats in the Senate to block it and cause a shutdown. That’s what happened in December, when Democrats agreed to punt the DACA issue until January despite earlier promising their supporters it would be settled by the end of the year. Democrats up for reelection in 2018 and representing states Trump carried will be hard-pressed to vote for a shutdown after criticizing conservatives for doing the same thing under President Barack Obama in 2013. But Democrats will be risking a deeper rupture with their base if they’re seen as bowing to Trump’s bullying and jeopardizing the Dreamers.

In a Senate floor speech late Tuesday afternoon, Majority Leader Mitch McConnell pointed to a way out of the impasse by noting that with a ruling last week, a federal judge had temporarily blocked the Trump administration from ending the DACA program. The administration is appealing that decision, but in the meantime it announced it would resume accepting DACA renewals. McConnell said Congress had until March “at a minimum, and possibly even longer” to extend protections to young immigrants. “With no imminent deadline on immigration, and with bipartisan talks well underway, there is no reason why Congress should hold government funding hostage over the issue of illegal immigration,” McConnell said.

A third and potentially intriguing option for Republicans is to entice Democrats to support a funding bill without an immigration deal by attaching a long-term reauthorization of the Children’s Health Insurance Program. Democrats have been clamoring to renew CHIP and have attacked Republicans for delaying its reauthorization far beyond a deadline last fall. The two parties had been fighting over how to pay for a five- or six-year reauthorization, but they received something of a reprieve when a new projection from the Congressional Budget Office found that extending the program for 10 years would cost much less than originally thought and might save money.

If Republicans tied a clean CHIP extension to a short-term spending bill, could Democrats resist voting for it? It’s hard to see how the party would remain unified under that scenario, particularly when it would make it more difficult to blame a shutdown on Trump. Democrats spent years under Obama campaigning against Republicans as the party that hated government so much it shut it down, and many of them relish the possibility that the GOP, now in control of both Congress and the White House, would let their own internal divisions result in a shutdown. But Democrats don’t want to have to pull the trigger themselves—not if it would risk the advantage over the GOP they’ve spent a year building ahead of the 2018 midterm elections.

GOP leaders may complicate that strategy, however, by adding not only a CHIP reauthorization but legislation to delay several taxes imposed by the Affordable Care Act, according to Politico and Axios. Depending on which taxes they target, that move could win conservative votes but push Democrats away.

The government hasn’t shut down under Trump because neither Democrats, nor Republicans, nor even the president, really wanted it to. At each juncture, they’ve seized on whatever short-term, face-saving option was available to them. But as Trump fumes, a shutdown looms, and the DACA deadline nears, a climactic confrontation seems harder and harder to avoid.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.