WASHINGTON — The Senate on Monday voted to end the three day government shutdown after an “arrangement” was agreed to eventually allow a vote on protecting “Dreamers” from deportation.

The vote was 81-18 on a motion to end debate.

Senate Minority Leader Chuck Schumer (D-N.Y.) said he had reached a “commitment” with Senate Majority Leader Mitch McConnell (R-Ky.) to fund the government through Feb. 8. Under the terms of the “arrangement,” as Schumer called it,  legislation to protect “Dreamers” will be brought to the floor if a “global” agreement on issues like immigration, budget caps and spending is not reached before then.

The House now has to vote on the bill, but there is expectation that it will pass on Monday afternoon.

“It’s a shame…that the American people and the Senate have had to endure such hand wringing, finger pointing, stridency to secure a guarantee that we will finally move to address this urgent issue,” Schumer said from the floor. He also bashed President Donald Trump, not only for backing away from several bipartisan deals, but for not being part of the process of settling the shutdown over the weekend. He said that the  “great deal-making president sat on the sidelines.”

McConnell treated it as a victory.

“If we have learned anything during this process, it is that the strategy of shutting down the government over illegal immigration is something the American people do not understand,” he said.

The shutdown started at midnight on Saturday after the Senate failed to reach an agreement on a short-term funding bill. Democrats wanted the legislation to include a resolution of the “Dreamer” issue, as the the Trump administration in March will phase out the existing program to provide protected status.

California’s two senators, Dianne Feinstein and Kamala Harris, both Democrats, each voted against the funding bill to reopen the government. Two Republicans, Mike Lee of Utah and Rand Paul of Kentucky, also voted no.

“The Majority Leader’s comments last night fell far short of the ironclad guarantee I needed to support a stopgap spending bill,” Harris said in a statement. She said that the government “made a promise to our Dreamers and it is long past time that we kept that promise.”

A deal looked likely going into the noon vote, after a number of moderate Democrats said that they planned to vote “Yes” after receiving assurances from McConnell on the “Dreamer” issue. On the Senate floor, senators from both parties smiled and laughed with one another — Sen. Roy Blunt (R-Mo.) with Sen. Amy Klobuchar (D-Minn.), or Sen. Sheldon Whitehouse (D-R.I.) with Sen. Lindsey Graham (R-S.C.). The display was a contrast to some of the rhetoric of the past few days, when it looked like divisions were hardening.

Some immigration and progressive groups expressed dismay that the Democrats did not demand an immediate vote on the Dreamers, and treated the “commitment” between McConnell and Schumer as just a three-week reprieve.

“Today’s cave by Senate Democrats — led by weak-kneed, right-of-center Democrats — is why people don’t believe the Democratic Party stands for anything,” said Stephanie Taylor, the co-founder of the Progressive Change Campaign Committee.

Others blasted Democrats for placing their trust in McConnell.

“We cannot rely on empty promises from those who have already proven to play politics with the lives of Dreamers,” said Lorella Praeli, director of immigration policy and campaigns at the American Civil Liberties Union.  “Today, Republicans — and too many Democrats — in Congress betrayed our American values and allowed bigotry and fear to prevail.”

After the vote, Sen. Susan Collins (R-Maine) and Sen. Joe Manchin (D-W. Va.) were part of a bipartisan group, called the “common sense coalition,” that had been meeting over the weekend to end the shutdown.

“In the end, I give our leaders a lot of credit for listening to the ideas that we put forward,” Collins said.

“They listened and that’s what moved it because we weren’t backing off,” Manchin said.

Trump crowed that the Democrats gave in, but the agreement between McConnell and Schumer sets up weeks of high-stakes negotiations where the president will have to determine what kind of deal he is willing to sign. Over the weekend, Schumer already expressed frustration over negotiating with Trump, saying that it is “like negotiating with Jell-O.”

Graham said that he would start to work on a more comprehensive solution on Monday, now that it looked like the government would reopen. Asked what role Trump should have in coming to a longer-term spending bill, he told reporters, “Be constructive, just be constructive.”

The past few days have seen a blame game over who was responsible for the shutdown. Trump referred to it as the “Schumer shutdown,” while Schumer himself noted often that it was the first time the federal government had closed when the executive and legislative branches were controlled by both parties.

The immediate impact of the shutdown was varied across federal agencies. Some closed to all but essential employees, while the FCC remained open, operating on reserve funding. A longer-term shutdown could have meant the FCC would have closed most of its operations. A protracted closure also could have forced federal courts to scale back operations as their reserve funding ran out.