By a bipartisan vote of 75-22, the Senate approved a $US467.5 billion ($A700 billion) spending package on Friday that will fund agriculture, transportation, housing, energy, veterans and other programs through the end of the fiscal year on September 30.
The package now heads to Democratic President Joe Biden to sign into law.
Funding for those programs was due to expire at midnight.
The vote partially resolves a bitter, months-long battle over government spending that at one point left the Republican-controlled House of Representatives leaderless for three weeks.
"To folks who worry that divided government means nothing ever gets done, this bipartisan package says otherwise," Senate Democratic leader Chuck Schumer said before the vote.
The package easily passed the Republican-controlled House of Representatives earlier this week.
But action in the Senate was delayed as some conservative Republicans pressed for votes on immigration and other topics. They all failed.
Congress must still work out a deal on a much larger package of spending bills, covering the military, homeland security, health care and other services. Funding for those programs expires on March 22.
Taken together, the two packages would cost $US1.66 trillion.
Far-right Republicans had pushed for deeper spending cuts to tame a $US34.5 trillion national debt.
All these measures were supposed to have been enacted into law by last October 1, the start of the 2024 financial year.
While Congress rarely meets that deadline, the debate this year has been unusually chaotic.
Congress has had to approve four temporary funding bills to keep agency operations limping along at their previous year's levels.
The spending bills include $US241.3 million in earmarks - local projects secured by individual lawmakers - requested by Democratic Senator Dianne Feinstein.
She died on September 29, 2023, two days before the start of the financial year.