Donald Trump has rubber-stamped a bill to fund the US government until 8 February, ending a three-day shutdown that saw hundreds of thousands of workers stay home.
The House of Representatives earlier backed the bipartisan agreement, hours after the Senate voted 81 out of 100 in favour, with Democrats stumping up 33 of the votes.
The deadlock saw federal employees off work without pay and national landmarks including the Statue of Liberty closed to the public.
Image: People in New York protested on Monday, calling for assurances on the Dreamers
Republicans needed 60 votes to unlock the funds, but with only 51 of the 100 Senate seats they were reliant on Democrats to get the vote through.
Democrats agreed to drop their objections in return for a Republican assurance to look at the Deferred Action for Childhood Arrivals (DACA) programme to protect the so-called ‘Dreamers’.
Senate Majority Leader Mitch McConnell agreed to debate the issue in the coming weeks.
:: Why has the US government shut down?
Image: Mitch McConnell says the Dreamers issue will be debated in the coming weeks
The programme – which shields more than 700,000 immigrants who entered the US illegally as children – is scheduled to end in March, following an order from President Trump last year.
However, the deal to end the shutdown gives no assurances that the Dreamers can stay in the country and has been criticised by immigration activists and some Democrats.
President Trump said he was pleased the Democrats had “come to their senses” but that he would only make a long-term deal on immigration “if and only if it’s good for our country”.
Image: The Statue of Liberty reopened on Monday
Image: A forklift truck sits idle in front of the Lincoln Memorial during the shutdown
White House press secretary Sarah Huckabee Sanders said the President’s focus was now on border security and that any deal on the Dreamers would be tied to funding for border security, which includes Mr Trump’s planned wall.
Sky News US Correspondent Mark Austin said: “It seems to be the Democrats who have blinked here.
“The issue of the children of illegal immigrants has been knocked down the road for about three weeks.
“There is a commitment from Republicans to try to do something about it, but no guarantee that they will.
Democrats may say Trump “sat on the sidelines” . But he sat on the sidelines and won ! Dems backed down . #GovermentShutdown
— Mark Austin (@markaustintv) January 22, 2018
“If an agreement is reached it would have to then pass through the House of Representatives, before being signed by Donald Trump, who is well known for saying one thing and doing another.
More from United States
“Anything could happen. It’s not a done-deal for the Democrats, they have merely bought themselves some more time.”
If no agreement is reached by 8 February, it will go automatically for legislation in the Senate, where it will then be voted on.