The US government partial shutdown is set to end after Senate Republicans and Democrats voted to approve a temporary funding bill.
Senator Chuck Schumer said Democrats would support the bill if Republicans addressed a programme that shields young immigrants from deportation.
Democrats refused to vote for the bill unless they secured protections for recipients of the Obama-era programme.
Mr Schumer said the three-day shutdown was expected to end in a few hours.
"We will vote today to re-open the government to continue negotiating a global agreement," Mr Schumer said.
He added that he was hopeful about talks on so-called Dreamers, more than 700,000 young immigrants brought to the US as children who were protected under the Obama-era Deferred Action for Childhood Arrivals (Daca) programme.
The Senate voted to advance the bill 81-18. Though the impasse is over, the upper chamber still has to grant final approval of the bill and send it back to the House of Representatives for a vote.
The legislation provides funding to keep the government open temporarily in the hope that Congress can reach a permanent funding agreement before 8 February.
"We need to move forward and the first step, the very first step, is ending the shutdown," Republican Senate leader Mitch McConnell said.
Why did the government shut down?
At midnight on Friday, lawmakers failed to agree on a spending bill. The bill was not a plan for funding for the whole of 2018, but would have kept things running until the middle of next month.
Efforts to reach a compromise ahead of the working week failed in a rare Senate session late on Sunday.
Democrats wanted President Trump to negotiate over immigration as part of a budget deal, but Republicans had said no agreement was possible while federal government services were closed.
Republicans wanted funding for border security - including a proposed border wall with Mexico - and immigration reforms, as well as increased military spending.
- BBC / Reuters