The Senate voted Monday to reopen the government, ending a three-day standoff that left federal agencies shuttered and hundreds of thousands of workers furloughed.

The House is expected to approve the bill later and send it to President Trump Donald John TrumpUS reimposes UN sanctions on Iran amid increasing tensions Jeff Flake: Republicans 'should hold the same position' on SCOTUS vacancy as 2016 Trump supporters chant 'Fill that seat' at North Carolina rally MORE, allowing the government to completely reopen on Tuesday.

Senators voted 81-18 to approve the stopgap spending measure lasting until Feb. 8 after Senate Majority Leader Mitch McConnell (R-Ky.) promised to allow an immigration bill to reach the floor next month.

ADVERTISEMENT

The final vote came two hours after the Senate voted with a large bipartisan majority to end a Democratic filibuster.

“After several discussions, offers and counteroffers, the Republican leader and I have come to an arrangement. We will vote today to reopen the government to continue negotiating a global agreement,” Senate Minority Leader Charles Schumer (D-N.Y.) said after clinching a deal with McConnell.

The deal falls short of the Democrats’ initial demand that Trump and GOP leaders agree to the rough outlines of a deal to replace the Deferred Action for Childhood Arrivals (DACA) program and protect hundreds of thousands of “Dreamers” facing deportation.

Trump and GOP leaders refused to negotiate on immigration while the government remained closed.

Schumer said McConnell has committed that if negotiators fail to reach an immigration deal before the stopgap spending measure expires on Feb. 8, “the Senate will immediately proceed to consideration of legislation” to protect Dreamers.

Schumer said McConnell has promised Democrats that immigration debate “will be neutral and fair to all sides.”

“Now there is a real pathway to get a bill on the floor and through the Senate. It is a good solution and I will vote for it,” Schumer said.

Democrats who supported the funding measure said they won two key concessions from McConnell: to bring a neutral immigration bill to the floor and to do it next month.

The bill also includes a six-year funding extension for the Children’s Health Insurance Program, a critical priority for members of both parties. As many as 20 states would have run out of CHIP money — affecting millions of children — if Congress did not reach a deal by Feb. 1.

“This was a really public commitment, it was specific and it was not just to one member but to the whole body,” said Sen. Brian Schatz Brian Emanuel SchatzVideo of Lindsey Graham arguing against nominating a Supreme Court justice in an election year goes viral Democrat on Graham video urging people to 'use my words against me': 'Done' Polls show trust in scientific, political institutions eroding MORE (D-Hawaii), who voted for the measure.

Other Democrats were unhappy with the deal, which came under heavy fire from liberal outside groups.

“It’s a great disappointment to me and it’s a great disappointment to the more than 300,000 DACA young people in the state of California,” said Sen. Dianne Feinstein Dianne Emiel FeinsteinMcConnell says Trump nominee to replace Ginsburg will get Senate vote Top Democrats call for DOJ watchdog to probe Barr over possible 2020 election influence Intensifying natural disasters do little to move needle on climate efforts MORE (D-Calif.), referring to Dreamers in her state facing deportation.

Asked whether she had full confidence that McConnell would keep his commitment, Feinstein said, “Chuck Schumer Chuck SchumerVideo of Lindsey Graham arguing against nominating a Supreme Court justice in an election year goes viral Graham signals support for confirming a Supreme Court nominee this year Pelosi orders Capitol flags at half-staff to honor Ginsburg MORE trusts him. I haven’t been party to that discussion so I really can’t comment.”

House Democratic Leader Nancy Pelosi Nancy PelosiSunday shows preview: Justice Ginsburg dies, sparking partisan battle over vacancy before election Trump is betting big on the suburbs, but his strategy is failing 'bigly' Trump orders flags at half-staff to honor 'trailblazer' Ginsburg MORE (Calif.) bluntly dismissed the agreement with McConnell as a bad deal.

“I don’t see that there’s any reason — I’m speaking personally and hearing from my members — to support what was put forth,” she told reporters.

Liberal groups accused Democrats of caving.

“It’s official: Chuck Schumer is the worst negotiator in Washington — even worse than Trump,” Credo Political Director Murshed Zaheed said in a statement. “Any plan to protect Dreamers that relies on the word of serial liars like Mitch McConnell Addison (Mitch) Mitchell McConnellMomentum growing among Republicans for Supreme Court vote before Election Day Trump expects to nominate woman to replace Ginsburg next week Video of Lindsey Graham arguing against nominating a Supreme Court justice in an election year goes viral MORE, [Speaker] Paul Ryan [R-Wis.] or Donald Trump is doomed to fail.”

Several senators seen as potential White House candidates for the Democratic Party in 2020 voted against the funding bill, including Sens. Cory Booker (N.J.), Bernie Sanders (I-Vt.), Elizabeth Warren (D-Mass.), Kirsten Gillibrand (N.Y.) and Kamala Harris (Calif.).

The three-week bill is identical to a monthlong House bill that Democrats blocked on Friday night. Only five Democrats backed that measure, while four Republicans joined Democrats in objecting.

In the end, however, Democrats worried they lacked an endgame for ending the shutdown and were suffering political damage as Republicans hammered them for holding government funding hostage.

A nationwide CNN poll conducted by SSR showed the Democrats’ lead on the generic ballot has shrunk to only a 5-point advantage. The poll was conducted last week before the shutdown began on Friday.

Democrats can claim a small measure of victory from McConnell’s promise to bring an immigration bill to the floor next month and allow an open amendment process.

But there’s no assurance that the House will take up the immigration legislation.

Earlier Monday, Democrats said they could not feel assured that McConnell would hold up his bargain after he promised moderate Republican Sen. Susan Collins (Maine) during the tax-reform debate to pass legislation shoring up the individual insurance market before the end of the year. That bill is still in limbo.

McConnell also promised Sen. Jeff Flake (R-Ariz.) — according to Flake’s version of events — that he would bring DACA legislation to the floor in January, something that has yet to happen and doesn’t appear likely at this point.

Collins told reporters before the vote that Democrats wanted stronger assurances.

“I do think it would be helpful if the language were a little bit stronger,” she said.

But GOP leaders felt they had the upper hand politically and refused to go any further.

“I think that’s all they’re going to get,” Senate Republican Whip John Cornyn (R-Texas) said before the vote.

Jordain Carney contributed.