Lawmakers agreed to end the shutdown Monday, voting in both chambers of Congress to fund the government for another three weeks while Democrats and Republicans hash out a deal on a spending bill that hinges on contentious immigration reform.

Senators voted 80-18 to reopen the government, a measure backed up by a 266-150 vote hours later in the House. The move ended a furlough for thousands of federal employees and reopened government operations after they were closed for three days.

The impasse was broken after Republican Senate leader Mitch McConnell said his party intends to consider legislation “that would address DACA, border security and related issues, as well as disaster relief.”

President Trump signed the measure Monday night and later sent out a gloating tweet about the resolution.

The government has been closed since early Saturday, when an earlier spending bill failed to pass.

(CARLOS BARRIA/REUTERS)

“Big win for Republicans as Democrats cave on Shutdown,” he wrote. “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!”

Senate bigs said they will return to negotiating a deal on the Deferred Action for Childhood Arrivals program, which protects from deportation nearly 800,000 so-called “Dreamers” brought to the U.S. illegally as children. Congress has until March, when DACA expires, to turn the program into legislation.

The spending approved Monday funds the government through Feb. 8. Legislation on DACA will go to the floor then if lawmakers haven’t already reached a deal, Senate leaders said. If Republicans renege their promise, another shutdown is likely.

Immigrant activists were upset Schumer and the Democrats — who’d vowed to fight until a DACA deal was done — had backed down so quickly.

Senate Minority Leader Chuck Schumer (D-N.Y.) announced his support for the compromise on the chamber's floor Monday afternoon.

(JOSHUA ROBERTS/REUTERS)

“It’s official: Chuck Schumer is the worst negotiator in Washington,” said Murshed Zaheed of the immigration advocacy group CREDO. He said any plan that relies on Republican leaders to keep their promises is “doomed to fail.”

Some Democrats with eyes on the 2020 elections had the same concerns and voted no on Monday’s compromise. Sens. Kirsten Gillibrand (D-N.Y.), Cory Booker (D-N.J.), Kamala Harris (D-Calif.) and Vermont independent Bernie Sanders, all potential presidential candidates, voted against the bill.

Harris said she couldn’t believe McConnell’s promise, and didn’t want to put the lives of Dreamers “in the hands of someone who has repeatedly gone back on his word.” McConnell had previously assured GOP colleague Jeff Flake of Arizona that he’d bring a bipartisan DACA bill to the floor in January.