The US has narrowly avoided a government shutdown - with just three hours to spare before current funding expired.
A rushed package means agencies will be able to continue operating as normal for the next 45 days, ending turmoil in Washington.
However, this temporary solution has dropped aid to Ukraine - an issue that will need to be revisited with a growing number of Republican lawmakers.
Had a deal not been reached, four million government employees would have been left unpaid - with national parks and financial regulators forced to shut their doors.
Active-duty soldiers would have had to work without pay, with nutrition aid to seven million poor mothers suspended.
There could also have been knock-on effects with airport security and border control, delaying passengers.
Democratic Senate majority leader Chuck Schumer said: "The American people can breathe a sigh of relief - there will be no government shutdown ... today, MAGA extremism has failed and bipartisanship has prevailed."
A shutdown had looked all but inevitable earlier in the week, with right-wing Republicans calling for government agencies to slash their budgets by up to 30% - a move that the White House and the Democrats rejected as too extreme.
That plan collapsed on Friday, with Republican House Speaker Kevin McCarthy abandoning those demands.
He instead relied on Democrats to pass the bill - putting his own job at risk - paving the way for the Senate to pass the measure 88-9.
Mr McCarthy later struck a defiant tone and dismissed concerns he could be ousted as leader, telling reporters: "I want to be the adult in the room, go ahead and try.
"And you know what? If I have to risk my job for standing up for the American public, I will do that."
It followed earlier controversy when Democrat Jamaal Bowman admitted he had triggered a fire alarm during efforts to pass the bill, forcing the evacuation of a Capitol office building.
The New York politician was caught on camera activating the alarm.
But his spokesperson insisted it was unintentional and added: "The congressman regrets any confusion."
The incident is under investigation and has even prompted calls for Mr Bowman to be expelled.
Meanwhile, President Joe Biden has welcomed the last-minute deal, and says it prevents "an unnecessary crisis that would have inflicted needless pain on millions of hard-working Americans".
He added: "I want to be clear - we should never have been in this position in the first place. Just a few months ago, Speaker McCarthy and I reached a budget agreement to avoid precisely this type of manufactured crisis.
"For weeks, extreme House Republicans tried to walk away from that deal by demanding drastic cuts that would have been devastating for millions of Americans. They failed."
Mr Biden went on to warn that US support for Ukraine cannot be interrupted when the country is at a "critical moment".