The bipartisan measure, which passed 71 to 28 in the dead of night, was now headed to the House of Representatives for what is expected to be another pre-dawn Friday vote.
If it passes the House, and President Donald Trump signs the bill into law, it would restrict the nation's second government shutdown in three weeks to just a matter of hours.
Federal operations were brought to a halt early Friday after Senator Rand Paul, a conservative in Trump's own Republican Party, blocked a vote on a spending deal before a midnight deadline for extending government funding.
Trump's administration was already preparing for a halt in operations.
The White House's Office of Management and Budget "is currently preparing for a lapse in appropriations," an OMB official said on condition of anonymity late Thursday, calling on lawmakers to get the measure to Trump's desk "without delay."
The bill, which includes a far-reaching deal that increases spending limits for the next two years and raises the federal debt ceiling until March 2019, would break the cycle of government funding crises in time for what is set to be a bruising campaign for November's mid-term elections.
The rebellion that simmered among Republicans and Democrats over the budget agreement boiled over when a determined Paul brought the Senate's work to a halt.
- 'Definition of hypocrisy' -
Moving legislation swiftly through the upper chamber of Congress requires consent by all 100 members, but Paul objected.
The Kentucky Republican took the floor to blast the increase in federal spending limits, and in particular the fiscal irresponsibility of his own party.
"I can't in all good honesty and all good faith just look the other way because my party is now complicit in the deficits," Paul said.
"If you're against president (Barack) Obama's deficits, but you're for the Republican deficits, isn't that the very definition of hypocrisy?" he boomed, adding that he wants his fellow lawmakers "to feel uncomfortable" over the impasse.
But top Senate Democrat Chuck Schumer warned that the delay put lawmakers "in risky territory."
A McConnell lieutenant, Senator John Cornyn, also fumed about Paul's gambit.
"I don't know why we are basically burning time here," an exasperated Cornyn said. "We are in an emergency situation."
But Paul refused to yield and allow an early vote, forcing a shutdown while highlighting his policy priorities about excessive government spending.
"I think this has been a very useful debate," Paul said shortly before the vote.
The bill headed to the House, but its fate there is far from certain.
Fiscal conservatives in the lower chamber may join with Paul in balking at adding billions of dollars to the national debt two months after passing a $1.5 trillion tax cut package.
- $300 billion more -
And liberal stalwarts including top House Democrat Nancy Pelosi were also in revolt because the deal does nothing to protect young undocumented immigrants from deportation.
House Speaker Paul Ryan issued a statement welcoming the Senate's passage of the measure.
"Now it's time for the House to do its job," Ryan said.
The temporary spending bill under consideration incorporates the major budget deal reached between Senate leaders on both sides of the political aisle.
That agreement includes a $300 billion increase to both military and non-military spending limits for this year and 2019, and raises the debt until March 1 next year.
It also provides a massive $90 billion disaster relief package and funding to address the nationwide opioid abuse crisis.
Democrats have sought to link the federal funding debate to a permanent solution for hundreds of thousands of "Dreamer" immigrants who were brought to the country illegally as children.
Dreamers were shielded from deportation under the Obama-era program called Deferred Action for Childhood Arrivals (DACA). But Trump ended the program last September, setting March 5 as a deadline for resolving the issue.
The White House's current proposal -- one that would put 1.8 million immigrants on a path to citizenship, but also boost border security, and dramatically curtail legal immigration -- has been panned by Democrats.
Several bipartisan efforts have stalled.//AFP