Congress has steered the US government clear of a shutdown hours before a midnight deadline.
It approved temporary federal spending that does not defund women's health care provider Planned Parenthood as Republicans had hoped.
The Senate and House, both controlled by Republicans, acted pragmatically to fund the government at current levels beyond Thursday's start of the new fiscal year.
The legislation heads to President Barack Obama who was expected to sign it before midnight (local time).
The stopgap measure only runs until December 11, setting up a new potential fiscal clash just 10 weeks from now.
But it avoids a repeat of 2013, when bickering legislators failed to reach a deal on spending and the government skidded into a damaging 16-day shutdown.
Obama, speaking at the White House, hailed the congressional action.
"It looks like the Republicans will just barely avoid shutting down the government for the second time in two years," he said.
House Republican Charlie Dent noted it would be "utterly reckless" to trigger a spending crisis over Planned Parenthood.
"Whether you like them or not isn't the point. We should never shut the government down over that or frankly any other issue at this time."
The spending includes funding for the women's healthcare and abortion provider long targeted by Republicans, and which is at the centre of a swirling controversy.
Debate exploded earlier this year, when abortion foes released secretly recorded videos that they said show Planned Parenthood officials discussing the for-profit sale of fetal tissue obtained during abortion procedures, which would be a violation of federal law.
Planned Parenthood insists the videos were deceitfully edited, and that its staff was merely discussing the process for obtaining the tissue and the legal payments by research facilities to cover expenses including transportation.
Appalled arch-conservatives called for a ban on all federal funding for the organisation, and had sought to use negotiations over spending as leverage to achieve their goal.
Efforts to pass a spending measure that blocked money to Planned Parenthood failed last week.
Wednesday's clean bill passed 78 votes to 20 in the Senate with more than half the chamber's Republicans voting in favor. No Democrats voted against it.
With the threat of shutdown defused, Republican leaders in Congress are turning toward talks with Obama over a long-term budget agreement for the remainder of fiscal year 2016, and potentially beyond.