WASHINGTON — The government is set to fully reopen on Tuesday, after congressional leaders finalized a new budget extension Monday evening.

The new deal gives lawmakers three more weeks to sort lingering disagreements over immigration and federal fiscal policies, but ends the controversial government shutdown after just three days. The measure was signed by the president around 9 p.m.

The budget legislation also includes a provision to provide back pay for troops and other federal workers for the time they missed because of the lapse in operations.

Non-essential programs began shutting down Saturday morning after the Senate failed to approve a four-week budget extension over Democratic concerns that broader issues were being ignored.

The three-day shutdown caused brief furloughs for hundreds of thousands of defense civilian employees, including workers at the Departments of Defense and Veterans Affairs.

Armed Forces Network television programming was briefly halted for overseas military bases as workers were sent home. Daycare centers on bases were shuttered, and many non-serious military medical appointments were cancelled. Some VA call centers were closed, and veterans were warned of possible office closings in the days to come.

Rep. Joe Wilson, R-S.C., chairman of the House Armed Services Committee’s readiness panel, said Monday that 2,000 South Carolina Guardsmen who were preparing to drill this weekend were sent home instead, and 750 Guard mechanics were laid off.

Senators spent the weekend negotiating on a new budget deal but also sniping at each other for betraying the troops by refusing to agree to a compromise.

Sen. Joni Ernst, R-Iowa, an Iraq War veteran, accused Democrats of “turning their back on men and women in uniform by putting our military’s resources and readiness in jeopardy.” Sen. Tammy Duckworth, D-Ill. Who also served in Iraq, called the short-term budget backed by Republicans “harmful to not just the military but to our national security.”

Senate Minority Leader Chuck Schumer, D-N.Y., said the new budget deal comes with a promise from Republican leadership that negotiations on the expiring Deferred Action for Childhood Arrival policy will continue over the next few weeks, with a possible vote in early February.

He praised lawmakers’ for the compromise but attacked President Donald Trump for his “glaring absence” during the negotiations. Both Trump and Republican leaders on the Hill said they would not discuss immigration issues while the government was shut down.

“The Senate cannot make progress on any of these crucial matters until the government is reopened,” Senate Majority Leader Mitch McConnell, R-Ky., said ahead of Monday’s vote.

“It’s evident that this government shutdown is doing nothing, absolutely nothing to generate bipartisan progress on the issues the American people care about,” McConnell said. “Every day we spend arguing about keeping the lights on is another day we cannot spend negotiating DACA or defense spending or any of our other shared priorities.”

Pentagon leaders and pro-defense lawmakers have lamented the short-term budget extensions as bad for military planning and morale, and repeatedly pushed for a full-year plan. But Republicans have thus far insisted on hefty increases for defense spending alone in any such deal, and Democrats have demanded equal increases for other non-military programs.

A contingent of pro-defense lawmakers lamented the latest budget extension, since a broader deal to ease statutory budget caps for military spending has still not been reached.

“I think the government should be reopened, but if this doesn’t address the underlying issue — spending caps — for this two-year period of time, what does Feb. 9 hold that [the last funding deadline] didn’t hold?” said Rep. Rob Wittman, R-Va., chairman of the House Armed Services seapower panel, ahead of the vote.

Still, that opposition is not expected to be enough to derail a deal and keep government operations shut down.

The three-week appropriations deal expires on Feb. 8, giving lawmakers just a few more days to try to reach agreement on an elusive full-year budget plan. Since Oct. 1, the start of the current fiscal year, all government functions have been operating off of last year’s funding levels.