Republican and Democrat leaders of the US Senate have struck a cross-party deal to end a partial government shutdown and raise the US debt limit.
Their bill must also pass the House, where a small group of Republicans are expected to join Democrats to send the bill to President Barack Obama.
The bill extends the federal borrowing limit until 7 February and funds the government to 15 January.
It comes just a day before the deadline to raise the $16.7tn (£10.5tn) limit.
On the floor of the US Senate, Democratic leader Harry Reid called the legislation “historic”, saying it would provide time for Congress to work toward a long-term budget agreement.
“Our country came to the brink of disaster,” he said.
Republican Senate Minority Leader Mitch McConnell, Mr Reid’s negotiating partner, said he was “confident” the government could reopen and avoid default under the proposed bill.
“Now it’s time for Republicans to unite behind other crucial goals,” he said.
Politicians, bankers and economists have warned of global economic consequences unless an agreement to raise the US government’s borrowing limit were reached.
The US Treasury has been using what it has called “extraordinary measures” to pay its bills since the nation reached its current debt limit in May.
Those methods will be exhausted by 17 October, US Treasury Secretary Jack Lew has said, leaving the US unable to meet all of its debt and other fiscal obligations if the limit is not reached.