The federal government barreled toward a partial shutdown Monday as the Democrats in Congress dug in their heels in a battle of political wills with President Trump and his Republican allies on Capitol Hill.

The Democrats are demanding relief from deportation for illegal immigrants who participated in the Deferred Action for Childhood Arrivals program as part of a deal to keep the lights on in Washington. It’s risky; the party in the White House tends to win shutdown fights, as Republicans learned in 2013 and previously.

But the Democrats are confident. They are convinced the uproar over Trump’s denigration of immigrants from Haiti and certain African nations by referring to them as coming from “shithole countries” has given them the upper hand in the debate.

“The politics, especially right now, is more about why the shutdown is happening — and, if there is a shutdown, it can easily be attributed to the unreasonable demands of a racist president,” Ed Espinoza, a Democratic strategist in Austin, Texas, said.

“The shutdown of 2013 essentially happened because Republicans could not keep Ted Cruz in line,” he added. “If there’s a shutdown in 2018, it will be because Republicans cannot keep Donald Trump in line.”

Republicans in the past 25 years have twice used their congressional majorities to shut down the government as a means to win concessions from a Democratic president. Twice the Republicans failed and folded after causing severe political damage to their party’s brand, once in late 1995 versus President Bill Clinton, once in late 2013 versus President Barack Obama.

Democrats, under pressure from their base to secure legalization for so-called Dreamers, adults brought to the U.S. illegally as children by their parents, appear ready to gamble that walking away from a spending deal will pay off. Trump his demanded billions for border security, including a physical wall across the southern border, an ask especially opposed by liberals.

Sen. Tom Cotton, a top Trump ally, is daring Democrats to take the plunge. In a Sunday post on Twitter, the Arkansas Republican said a Democratic shutdown would improve chances of GOP pick-ups in Senate races in states Trump won in 2016.

“So Democrats are now threatening to shut down the government if they don’t get amnesty for millions of illegal immigrants. Let’s see how that works out for them, especially in places like” West Virginia, Indiana, Missouri, North Dakota, and Montana, he said.

Trump has added his own voice on Twitter. He is attempting to define the Democrats as inflexible and recalcitrant, putting politics over compromise.

In one of the president’s most recent posts, he went after Senate Minority Whip Dick Durbin, D-Ill., among his party’s chief negotiators and who revealed that Trump used the term “shithole” in a private meeting in the White House.

“Senator Dicky Durbin totally misrepresented what was said at the DACA meeting. Deals can’t get made when there is no trust! Durbin blew DACA and is hurting our Military,” Trump said.

Democrats don’t have the votes to block a spending bill in the House. But in the Senate, where a 60-vote supermajority is required to approve appropriations, the Republicans are nine votes short, and that’s if they are unanimous, which on fiscal issues is rare.

The issue is whether the voters will reward the Democrats if they use the power of the 49-seat Senate minority to block the majority party in Congress and the White House. In the past, when Republicans prosecuted a similar challenge, voters deemed them unreasonable.

“I have yet to see a scenario in my entire life — going back to [President Ronald] Reagan — where a shutdown benefitted the Republicans politically,” a GOP strategist said. “Having said that, if it was ever clear that this is the doing of Democrats whose base won’t let them work with the president, it is now.”

If Republicans have a concern, it is that Trump’s occasionally undisciplined, erratic communications style will allow the Democrats to dominate the debate. That, and the president’s low job approval ratings and a possible midterm backlash against the GOP, is keeping the Republicans on edge.

“Republicans being Republicans, and with Trump's penchant for straying way off message, I can see them getting blamed as well,” a Republican insider said. “Voters don't understand the nuances of the whole 60-vote thing and it doesn't translate well into a short sound bite: ‘If they are in charge of everything, they are responsible for it, right?’”

If Democratic insiders are worried, it’s about Trump’s ability to amplify his message through conservative media.

“Republicans control the House, Senate, and White House so the idea of blaming Democrats because Republicans can’t get the job done is ridiculous,” Democratic strategist Rodell Mollineau said. “That won’t stop Trump from making that case forcefully, and I suspect his base and allies in the conservative media will help to amplify the charge regardless of its veracity.”