US lawmakers have voted to pass a two-year budget, meaning the country’s second shutdown in three weeks could end before the working day begins.
The measures have passed the Senate and the House but still need to be signed off by President Donald Trump.
Federal funding for government services expired at midnight (05:00 GMT), after the Senate missed a voting deadline.
The 650-page plan proposes an increase in spending, by about $300bn (£215bn), on defence and domestic services.
Senators struggled with last-minute objections from Republican Rand Paul, meaning they did not vote in time. The shutdown came within three weeks of the last one, as lawmakers wrangle over the spending plan and other political demands on either side.
The House approved the bill by 240 votes to 186. The Senate had passed it by 71 to 28 three hours earlier.
House Speaker Paul Ryan said the bill was “a great victory for our men and women in uniform” as the military would get more resources.
He said: “Ultimately, neither side got everything it wanted in this agreement, but we reached a bipartisan compromise that puts the safety and wellbeing of the American people first.”
While the spending bill’s funding for the Pentagon delighted the national security wing of the party, fiscal conservatives were concerned about ramifications for the nation’s debt.
In a doom-laden speech, Senator Paul angrily charged his fellow Republicans with fiscal profligacy, accusing his colleagues of “spending us into oblivion”.
“I ran for office because I was very critical of President Obama’s trillion-dollar deficits,” he said.
“Now we have Republicans, hand in hand with Democrats, offering us trillion-dollar deficits.
“I can’t in all good honesty, in all good faith, just look the other way just because my party is now complicit in the deficits.”
This would be “the very definition of hypocrisy”, he added.
The 650-page spending plan was only unveiled on Wednesday night, so the finer details are still unclear.
White House legislative affairs director Marc Short said the package would increase spending by “just shy” of $300bn.
The Washington Post put the figureat half a trillion dollars.
The bill contains $165bn of additional defence spending and $131bn in domestic spending, including funding for healthcare, infrastructure and tackling the US opioid crisis, reports Reuters news agency.
The proposal would raise the US debt ceiling until March 2019.