WASHINGTON — After months of turmoil that included the longest government shutdown in American history, Congress has reached a government funding deal that would give President Trump even less money for a wall than what Democrats had originally offered him.

The bill is on track to pass through Congress before another partial shutdown would be triggered at end-of-day Friday. Trump said Tuesday he is “extremely unhappy” with the deal, but stopped short of saying he would veto it.

In December Trump demanded $5.7 billion for 200 miles of border barriers, and triggered a shutdown when Congress agreed to only $1.6 billion for 65 miles of barriers. The new deal contains less than what was on the table originally — $1.375 billion for 55 miles of barriers along the Rio Grande.

“So we shut down the government for 35 days, we put America through this crisis, we jeopardized our economy, and for what?” said Democratic Sen. Dick Durbin.

The barriers come with certain restrictions and cannot be built with concrete. This has Democrats referring to it as “fencing” while Republicans tend to use more robust words.

“I guess we’re going to have an argument now about what’s a wall,” said Senate Majority Leader Mitch McConnell.

Ahead of a cabinet meeting at the White House Trump said he does not expect to see another shutdown. “I’m not happy about [the deal]” he said. “It’s not enough, it’s not doing the trick. But I’ll add some to it.” In practice, Trump will have no opportunity to add anything. Congress negotiated the deal without Trump and, if passed, his only choices will be signing the bill or vetoing it and triggering yet another shutdown.

The text of the bill is still being written, allowing all sides to hedge their support on needing to see the details. But Republican leadership is already urging Trump to sign it and Democrats are all-but-daring him to say no. “We’re the ones who do spending bills. If the White House doesn’t like it, fine, veto it,” said Sen. Patrick Leahy, one of the key Democratic negotiators.

Rep. Mark Meadows, chairman of the the hardline conservative House Freedom Caucus, said of the wall funding “obviously this is not a number I support or believe should be supported.” But he said he expects Trump to begrudgingly sign the deal and there’s likely nothing that can be done about it. “I don’t know that the Freedom Caucus has any leverage to go to the mats on it,” he said, given that Democrats now control the House.

Negotiations briefly got tied up over detention beds for undocumented immigrants captured in the United States, but that battle was fought to a draw. Democrats sought a cap on the number of people that could be detained, while Republicans sought money for more beds. There are currently 49,000 people being detained. In the end the status quo prevailed, but Republicans say Trump will have the power to “reprogram” funds from anti-drug programs to detention beds.

Some Republicans said they believed Trump could also reprogram unspent funds from other anti-drug programs to build more border barriers. The total amount of funds available ranged from around $2 billion to over $5.7 billion depending on who you ask, but Democrats are already warning that this applying this method would spark legal challenges.

Over the past two years Trump has repeatedly pressed for more border wall funding and each time been rebuffed by Congress. His chances got significantly worse this month as Republicans ceded control of the House of Representatives to Nancy Pelosi.

This has led Trump to publicly mull ways to circumvent congressional approval. Another option he’s discussed is declaring a state of emergency to open up discretionary funds he can put towards a wall.

Republicans have warned Trump against this course of action, saying it would be challenged in the courts through to the end of Trump’s first term. Congress could also pass a resolution of disapproval to block a national emergency declaration, potentially leading Trump to issue his first veto; it’s unclear if Congress would have the votes to override it. Senate Republicans also expressed concerns about setting a dangerous precedent with a national emergency, and they may have reason to worry.

Democratic Sen. Chris Murphy told BuzzFeed News that Republicans should be “very scared” of Trump vastly expanding the scope of presidential emergency powers.

“I can’t wait for the next Democratic president to issue a health care national emergency and immediately transfer our system to Medicare for All,” he said.

“I am kind of joking, but certainly if he were to do this it would absolutely open the door to a Democratic president declaring a health care emergency, an immigration emergency, a climate change emergency. Once the horse runs out of the barn on expansive national emergency powers, nobody’s putting it back in.”

If this deal gets signed into law the government would be fully funded for 2019, putting off the threat of another shutdown until next year at the earliest.