WASHINGTON — Congress is barreling toward a pre-Christmas partial government shutdown after President Donald Trump said Thursday he refuses to sign a funding bill that doesn’t have any money going toward the construction of a border wall.

Both the Senate and the House of Representatives have passed bills to keep the government funded until February. The problem is the two don’t match — the House version includes $5 billion for border wall construction, while the Senate bill has none.

They have until midnight tonight to pass a bill. After that point several federal agencies including the departments of Homeland Security, Justice, and State run out of funding. A standoff could leave those agencies shuttered for weeks.

A deal seemed done as early as midday Thursday, but then Trump announced he would refuse to sign any bill that does not include wall funding. This came after Trump was visited by Reps. Mark Meadows and Jim Jordan of the far-right Freedom Caucus and the funding deal was widely panned by conservative commentators on Fox News and elsewhere. Their argument is that Republicans must insist on wall funding now while they still control both the House and the Senate, because they fear they will not get it after Nancy Pelosi becomes House speaker in January.

“It would be disingenuous to say that our leverage increases next year,” said Meadows. “The wall fight will continue on but I’m not as optimistic as winning.”

The problem is the math still doesn’t work for them now or next year. Democrats have said $5 billion of border wall funding will not get anywhere close to the 60 votes needed to pass the Senate. Pelosi and Senate Minority Leader Chuck Schumer accused Trump of “plunging the country into chaos.” Making life even more difficult, many senators have already gone back to their home states for the holiday break.

Trump had been threatening for months to shut down the government if Democrats did not provide full funding for the wall in the federal budget.

But any shutdown would not be quite as dramatic as those in the past because Trump had already signed bills passed by Congress earlier this year to fund other federal departments through the end of September 2019, including the departments of Defense, Health and Human Services, and Veterans Affairs, among others. Those will stay open entirely during the shutdown.