WASHINGTON — Congress voted to end the government shutdown Monday after three days of tense negotiations resulted in a three-week spending bill that sets up another potential showdown next month.

President Donald Trump signed the measure Monday night, officially ending the standoff, for the time being.

Earlier in the day, Senate Democrats paved the way for the deal ahead of a noon vote on a key procedural measure that needed their support to end the funding impasse. Senate Minority Leader Chuck Schumer, D-N.Y., said Democrats would drop their objections to the bill in exchange for GOP assurances that Congress would take up a larger immigration bill in the coming weeks.

Once it cleared the Senate on Monday afternoon, the House quickly approved the stopgap measure by a 266-150 vote.

The decision by Democrats to end the shutdown has divided the party, with some members saying they received enough of a public assurance from Senate Majority Leader Mitch McConnell, R-Ky., to hold him accountable and others saying that the party caved.

Schumer said he believes McConnell will hold a vote, with an open process, on DACA — the Obama-era program that allows people brought to the country illegally as children to stay.

“After several discussions, offers, counteroffers, the Republican leader and I have come to an arrangement," Schumer said on the Senate floor Monday. "We will vote today to reopen the government to continue negotiating a global agreement, with the commitment that, if an agreement isn’t reached by Feb. 8, the Senate will immediately proceed to consideration of legislation dealing with DACA.”

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

McConnell also spoke after Democrats withdrew their objections. "I think if we learned anything during this process, it’s that a strategy to shut down the government over an issue of illegal immigration is something the American people didn’t understand," he said. "And would not have understood in the future. So I’m glad we’ve gotten past that and we have a chance now to get back to work."

Trump said in a statement that he was "pleased that Democrats in Congress have come to their senses."

"My administration will work toward solving the problem of very unfair illegal immigration. We will make a long-term deal on immigration if, and only if, it is good for our country," he added.

The president later tweeted that he wants "a big win for everyone, including Republicans, Democrats and DACA, but especially for our Great Military and Border Security.."

Big win for Republicans as Democrats cave on Shutdown. Now I want a big win for everyone, including Republicans, Democrats and DACA, but especially for our Great Military and Border Security. Should be able to get there. See you at the negotiating table! — Donald J. Trump (@realDonaldTrump) January 23, 2018

A bipartisan group of two dozen senators, led by Sen. Susan Collins, R-Maine, worked behind the scenes throughout the morning to find a solution. And they succeeded.

Democrats emerged from a caucus meeting announcing they would support the measure. And despite Democrats' lack of trust in McConnell, the group of Republicans in the bipartisan talks promised they'd hold McConnell accountable if he broke his word.

"There's assurances from Republicans that they want to see this bill come forward and debated, and it doesn't mean there's agreement as to what that actual bill is, that's still a work in progress, but there is a good faith belief that this is an issue we need to address and we need to address it in a bipartisan way," said Sen. Gary Peters, D-Mich.

The bill will extend government funding through Feb. 8. It will also extend the low-income children's health insurance program, CHIP, for six years and suspend some taxes under the Affordable Care Act.

Sen. Mark Warner, D-Va., said Democrats got enough to satisfy them moving forward. “We got a path clear on how we’re going to get a full year budget and we got a path clear on how we’re going to start the immigration debate. I think that’s significant. That’s not what we had before.”

The decision is dividing Democrats, however, with 16 of them voting against the measure, saying they didn't get enough of a guarantee on DACA.

“Our government made a promise to our 'Dreamers' and it is long past time that we kept that promise," Sen. Kamala Harris, D-Calif., said in a statement, referring to DACA recipients. "These are young people who are Americans in every respect except on paper. They have been waiting far too long to live securely in the only place they have ever called home."

A Democratic aide to one member who voted against the funding measure said the party had "caved."

"A unified party against immigrants needs to be met by a unified party for immigrants. That wasn’t the case today," the aide said.

But the 33 Senate Democrats who voted to advance the measure maintain they fought to protect DACA, which they feel Republicans would not otherwise have made a priority.

"There’s no way Leader McConnell would have done this had we not stood firm," Sen. Brian Schatz, D-Hawaii, said.

A key development over the next three weeks will be what Trump, who was largely out of sight during the tensest moments of the negotiations, will be looking to get out of the next round of talks.

"Right now, again, we want a permanent solution to that [DACA] program," White House spokesperson Sarah Huckabee Sanders told reporters Monday. "But we also want to keep a big priority for the administration is making sure we don’t find ourselves having the same battle in two, three, four and five years down the road. So we have to have a responsible immigration reform that addresses a number of issues, not just the DACA program."