The US Congress approved a bill on Monday to fund the government for two and a half weeks and halt a three-day shutdown after Senate Democrats accepted Republican leaders' assurance that they would bring an immigration bill to the floor for discussion in the coming weeks.
The House, as expected, then followed suit and approved the bill, 266-150. President Donald Trump signed the bill Monday night, effectively ending the shutdown.
The federal government is now reopened after remaining shut down for three days beginning Saturday. Because of the weekend, the actual shutdown was only for one working day on Monday, when hundreds and thousands of government employees remained at their homes.
Lawmakers in the Senate and the House of Representatives were rushing through procedural legislative motions to fund the spending bill of federal government by 17 days till 8 February.
"After several discussions, offers and counteroffers, the Republican leader and I have come to an arrangement. We will vote today to reopen the government to continue negotiating a global agreement," Senate Minority Leader Charles Schumer announced on the Senate floor much to the jubilation of federal employees.
Thereafter Schumer said the Republican leadership has promised that if they fail to reach an immigration deal before the stopgap spending measure expires on 8 February "the Senate will immediately proceed to consideration of legislation" to protect Dreamers, or the children of illegal immigrants. It was the Dreamers issue that mainly led to the shutdown.
''Now there is a real pathway to get a bill on the floor and through the Senate. It is a good solution and I will vote for it," Schumer added.
Trump's attempts to negotiate an end to the shutdown with Senate Democratic leader Schumer collapsed on Friday in recriminations and finger-pointing. The Republican president took a new swipe at Democrats as he celebrated the Senate's pact.
"I am pleased that Democrats in Congress have come to their senses," Trump said in a statement. "We will make a long term deal on immigration if and only if it's good for the country."
Immigration and the budget are entangled because of Congress' failure last year to approve a budget on time by 1 October, just weeks after Trump summarily ordered an end by March to Obama-era legal protections for Dreamers.
The budget failure has necessitated passage by Congress of a series of temporary funding measures, giving Democrats leverage each step of the way since they hold votes needed to overcome a 60-vote threshold in the Senate for most legislation.
With government spending authority about to expire again at midnight on Friday, Democrats withheld support for a fourth stopgap spending bill and demanded action for the Dreamers.
There are roughly 700,000 young people were brought to the United States illegally as children, mainly from Mexico and Central America. They mostly grew up in the United States.
Former President Barack Obama's Deferred Action for Childhood Arrivals, or DACA, programme gave the Dreamers legal protections and shielded them from deportation.
Democrats, as a condition of supporting a new spending stopgap, demanded a resolution of the uncertain future Trump created for the Dreamers with his DACA order last year.
But Democratic leaders, worried about being blamed for the disruptive shutdown that resulted, relented in the end and accepted a pledge by Republicans to hold a debate later over the fate of the Dreamers and related immigration issues.
The shutdown undercut Trump's self-crafted image as a dealmaker who would repair the broken culture in Washington.
It forced Trump to cancel a weekend trip to his Mar-a-Lago estate in Florida and created uncertainty around his scheduled trip this week to the World Economic Forum in Davos, Switzerland.
The US government cannot fully operate without funding bills that are voted in Congress regularly. Washington has been hampered by frequent threats of a shutdown in recent years as the two parties fight over spending, immigration and other issues.
The last US government shutdown was in 2013.