The government shutdown was poised to end after members of the Senate were able to break their impasse over a new short-term spending bill after working through the weekend.

The Senate moved to end the three-day shutdown of the U.S. government after Democrats agreed to a deal that would buy almost three weeks’ time for Congress to resolve the disputes over spending and immigration that led to the closing.

The chamber agreed 81 to 18 to end debate, a procedural move that clears the way for a temporary funding plan through Feb. 8 — the culmination of days of deal making that unfolded as both parties traded blame for the government closure that began at 12:01 a.m. Saturday.

Senate Minority Leader Chuck Schumer said he and Senate Majority Leader Mitch McConnell had “come to an arrangement,” with Schumer saying he believed there was a “real pathway” to get a bill dealing with immigration on the floor of the Senate. But Monday’s bargain may only postpone debates that illustrate the deep divisions among the two parties, conservatives in the House and President Donald Trump.

For the shutdown to end, the House must also approve the bill and Trump must sign it as well.

House Majority Leader Kevin McCarthy of California told colleagues on Sunday that the chamber will take up whatever the Senate passes, according to a Republican House member. The measure likely will clear the House, the lawmaker said.

Still, Speaker Paul Ryan has promised House Republicans that they will not be bound by any arrangement reached in the Senate on immigration to reopen the government, House Freedom Caucus Chairman Mark Meadows and Representative Doug Collins of Georgia said on Sunday.

Senate Democrats, who had sought firmer guarantees from McConnell on immigration, were initially reluctant to accept his terms. Democrats, and some Republicans, wanted language protecting people in the Deferred Action for Childhood Arrivals, or DACA, program, as part of the spending bill to ensure it became law. Some Republicans have opposed such a move, calling it amnesty.

Trump decided in September to end an Obama-era initiative that shielded them from deportation, effective in March, although he said Congress should act to protect them. The U.S. counts 690,000 people currently enrolled in DACA.

The White House had refused to negotiate over immigration, one of the Democrats’ central issues, while the government remained closed. Trump blamed Schumer for the shutdown.