Elected officials in the US approved an annual spending package on Friday that includes $45 billion in aid to Ukraine and reforms to election law designed to avoid a repeat of last year's assault on the Capitol.
The $1.7 trillion bill is now heading to President Joe Biden's desk for a final signature.
“The bipartisan funding bill advances key priorities for our country and caps off a year of historic bipartisan progress for the American people,” he said in a statement.
The package passed by senators on Thursday was rubber-stamped by the House of Representatives hours before a midnight deadline to keep the federal government open.
Failure to get the package to Mr Biden's desk would have been an embarrassment for the president, days after Ukrainian leader Volodymyr Zelenskyy visited the White House to seek the $44.9bn emergency military and economic aid proposed as part of the legislation.
But it enjoyed a smooth passage through the lower chamber, where Democrats have a slim majority for a few more days, until the Republican-led 118th Congress opens.
Ten Republicans cast votes in favour to help see the package cross the line by 225 votes to 201.
“This bill is good for our economy our competitiveness, and our communities — and I will sign it into law as soon as it reaches my desk,” Mr Biden said.
The bill keeps the lights on until next October, paying for almost every aspect of the day-to-day management of the federal government, from law enforcement to printing money.
But it also features add-ons less clearly connected to funding, such as a reform tightening a 19th century election law to make clear that vice presidents do not have the power to overturn election results.
House minority leader Kevin McCarthy had also urged Republicans to vote no, arguing that his side would have more sway in negotiating federal spending when they take over the lower chamber from the Democrats in early January.
The House was half empty on Friday, with more than 200 representatives using an absentee voting provision, strictly meant only for those with coronavirus, to stay home and cast their ballots by proxy.
Members rushed the vote so they could travel amid a once-in-a-generation winter storm ahead of the Christmas holiday.
“We are two days away from Christmas,” Mr McCarthy said.
“The Christmas season is the season of giving, but in Congress it appears the season of giving will line the pockets of Democrats' special interests and stick the hard-working Americans with the tab.”
AFP contributed reporting