The US government partial shutdown is ending after Republicans and Democrats voted for a temporary funding bill.
The Democratic leadership agreed to back the bill after accepting promises from Republicans for a debate later on the future of young illegal immigrants.
President Donald Trump, who signed the bill on Monday evening, took a swipe at Democrats.
It is the fourth temporary measure since October because Capitol Hill cannot agree a longer-term budget.
The spending bill passed the Senate by 81-18 and the House of Representatives by 266-150 earlier on Monday.
The so-called continuing resolution keeps the government funded until 8 February in the hope that Congress can reach a longer-term budget agreement in the meantime.
Thousands of federal employees who had been placed on temporary, unpaid leave since Saturday breathed a sigh of relief.
“It was essentially a lunch break,” Tom Chapel, a scientist at the Centers for Disease Control and Prevention in Atlanta, Georgia, told Reuters news agency.
What are Republicans saying?
Republican Senate leader Mitch McConnell said his party had “come to an arrangement” to negotiate on the Democrats’ calls for an immigration deal.
Democrats want protections from deportation for so-called Dreamers, more than 700,000 young immigrants brought to the US as children.
But Republicans had insisted no agreement was possible while federal government services were closed.
President Trump, a Republican, said in a statement: “I am pleased that Democrats in Congress have come to their senses.
“We will make a long-term deal on immigration if, and only if, it is good for our country.”
Did Democrats ‘cave’?
Democrats voiced scepticism of Mr McConnell’s promise and some liberal groups are infuriated by the agreement to reopen the government.
Possible Democratic 2020 presidential candidates in the Senate – Elizabeth Warren, Kirsten Gillibrand, Cory Booker, Bernie Sanders and Kamala Harris – all voted against Monday’s bill.
Senator Harris, of California, said it would be “foolhardy” to trust Mr McConnell’s promise to take up an immigration bill in the coming weeks.
Another California senator, Dianne Feinstein, told The Hill, a political news outlet, she was “very disappointed” in the deal because there’s no guarantee that Republicans would help Dreamers.
Democratic congressman Luis Gutierrez slammed his own party’s senators after the vote saying: “They caved. They blinked. That’s what they do.”
On Twitter, “Democrats CAVED” was trending on Monday evening.
Senate Democratic leader Chuck Schumer accused President Trump of failing to help reach a deal.
“The great deal-making president sat on the sidelines,” he said.
But many have expressed dissatisfaction with Mr Schumer’s handling of the shutdown, which began on midnight on Friday.
“It’s Schumer’s job to lead and keep his caucus together to fight for progressive values, and he didn’t do it,” said Ezra Levin, co-executive director of the activist group Indivisible.
Stephanie Taylor, of the Progressive Change Campaign Committee, said: “Today’s cave by Senate Democrats – led by weak-kneed, right-of-centre Democrats – is why people don’t believe the Democratic Party stands for anything.”
Why don’t shutdowns happen elsewhere?
In parliamentary systems, a government that can’t pay the bills doesn’t last long.
In 2012, for example, the Dutch government couldn’t agree a budget. The prime minister resigned, elections were held, and a new government formed.
Some countries don’t even need a government to function.
After its 2010 election, Belgium went more than 500 days without elected leadership, but still avoided a shutdown.
Taxes were collected, workers were paid, and a caretaker government passed a budget.
In France – a semi-presidential system – the constitution sets out what happens when a budget isn’t passed.
The government, it says, shall “make available by decree the funds needed to meet commitments already voted for”.
Really, the question isn’t why other countries don’t shutdown. It’s why the US does shutdown, even when there’s money sloshing round the system.
That stems from 1980 and 1981, when US Attorney General Benjamin Civiletti strictly interpreted the 1884 Antideficiency Act, reports BBC.
He said, in the event of a funding gap, government agencies should suspend operations – until money was appropriated by Congress.