This post was last updated at 1:15 p.m. EST. Alice Ollstein and Tierney Sneed contributed.

The Senate voted to end a government shutdown on Monday afternoon after Democrats agreed to support a short-term deal in exchange for a promised vote on a bill to protect undocumented immigrants brought here as children.

The lopsided 81-18 vote is a major step towards ending a shutdown that had begun as the clock hit midnight on Friday night. And while many immigration advocates are irate about a deal they see as a capitulation, it’s far from the end of the fight over immigration and government funding.

“The Republican leader and I have come to an arrangement. We will vote today to reopen the government,” Senate Minority Leader Chuck Schumer (D-NY) said on the Senate floor early Monday afternoon. “The Republican majority now has 17 days to prevent the DREAMers from being deported.”

The deal will keep the government open until Feb. 8, prolonging the showdown over whether to return legal status to undocumented immigrants brought here as children as well as the fight over military spending levels and other major issues. The bill also funds the Children’s Health Insurance Program, which is running out of funds, for the next six years. And it brings a temporary reprieve for federal government workers as well as the red-state Democrats who were increasingly panicking the deal could imperil their reelection chances.

“If we’ve learned anything during this process, it’s that a strategy to shut down the government over the issue of illegal immigration is something the American people didn’t understand and would not have understood in the future,” Senate Majority Leader Mitch McConnell (R-KY) said shortly before the vote.

McConnell committed to bring a version of the DREAM Act to the floor and let it be debated through an open amendment process if lawmakers can’t agree to a deal before then.

“The outcome is not preordained. There may be a new version that can attract even more support.” Sen. Susan Collins (R-ME), a moderate working towards a bipartisan deal, told reporters shortly after the vote.

Senate Democratic leaders’ decision to take the deal was immediately lambasted as a cave-in from immigrant advocates and many on the left, and could hurt the party with its base, though Senate Democrats from states Trump won are glad the fight is over for now.

Senate Minority Whip Dick Durbin (D-IL), the leading advocate fighting for legal status for undocumented immigrants in the Senate, backed up Schumer’s move before bucking up immigration advocates who are furious about a move many see as a cave.

“To all the DREAMers who are watching today: Don’t give up,” Durbin said. “Three weeks from now, I hope to be joining you and celebrating.”

But while Durbin and most Democrats came along, many of the party’s other fiercest immigration advocates — and nearly all of its potential 2020 presidential candidates — voted against it.

Among the no votes: Potential presidential candidates Sens. Kamala Harris (D-CA), Elizabeth Warren (D-MA), Bernie Sanders (I-VT), and Sen. Cory Booker (D-NJ).

“I don’t believe he made any commitment whatsoever and I believe it would be foolhardy to believe he made a commitment,” Harris said about McConnell’s promise for a DACA vote.

Notably, Sen. Jon Tester (D-MT) also voted against the move — significant both because he’s the only red-state Democrat facing a tough 2018 reelection to do so, and because of how far he’s come on immigration since voting against the DREAM Act in 2010.

Tester said DACA wasn’t the reason he voted against the deal, however, lambasting the inability for Congress to offer the military long-term stability and a boost in spending.

“There is nothing about our military having the predictability it needs. It’s another CR with another CR that’s going to happen after that CR,” he told reporters as he exited the vote. “There’s just no commitments except for DACA and that’s not why I voted no on Friday. It was because this whole place is screwed up.”