Last-gasp moves to prevent a US government shutdown became legislation late on Saturday, when President Joe Biden signed the bill to extend government for 45 days.
Democrats overwhelmingly backed an eleventh-hour Republican measure to keep federal funding going, which comes with a freeze on Washington's aid to Ukraine.
The stopgap measure, adopted 335-91 by the House of Representatives, was pitched by Speaker Kevin McCarthy with just hours to go before a midnight shutdown deadline that would have seen millions of federal employees and military personnel sent home or required to work without pay.
Ninety of the votes against the measure came from Republicans.
The shutdown crisis was largely triggered by a small group of hardline Republicans who had defied their party leadership to scupper various temporary funding proposals as they pressed for deep spending cuts.
Saturday's agreement could end up costing Mr McCarthy his job, as the hardliners had threatened to remove him as Speaker if a measure they opposed was passed with Democrat support.
Mr McCarthy had appealed to both Republicans and Democrats to “put your partisanship away” and dismissed the threat to his job.
“If somebody wants to remove me because I want to be the adult in the room, go ahead and try,” he said.
Ukraine's war spending
The proposed plan, now on hold until mid-November, would keep the government funded at current levels without the hardline-backed spending cuts that Democrats had viewed as a non-starter. But it also does not include funding for Ukraine.
Responding to the move, US Defence Secretary Lloyd Austin said he welcomed congressional action “to avert an unnecessary and destructive government shutdown,” while urging Congress “to live up to America’s commitment to provide urgently-needed assistance to the people of Ukraine.”
Michael McCord, under secretary of defence, had earlier said that current funding was nearly exhausted.
“Without additional funding now, we would have to delay or curtail assistance to meet Ukraine’s urgent requirements, including for air defence and ammunition that are critical and urgent now as Russia prepares to conduct a winter offensive and continues its bombardment of Ukrainian cities,” Mr McCord said.
Some commentators say existing drawdown resources – weapons and ammunition already committed – would continue being delivered until December, but advocates of more military aid to Ukraine say not enough is being done.
The US has committed around $45 billion to Kyiv in military support since the war began 19 months ago, while the EU has committed around $27 billion.
Officially, Russia's defence budget in the three years before the war was around $40-50 billion dollars, jumping to about $70 billion in 2022. Moscow's allocation for the war effort this year is $84 billion, although analysts say the actual sum could be far higher, as the economy is mobilised for war.
Ukraine's defence budget in the year before the war was just $5.9 billion, but it jumped 640 per cent in 2022, to around 44 billion. This year, the US defence budget reached a record $816 billion.
Arming and funding Ukraine in its war against the Russian invasion has been a key policy plank for President Joe Biden's administration. While the stopgap is only temporary, it does raise questions over the political viability of renewing the multibillion-dollar flow of assistance.
The Senate had been prepared to vote on its stopgap bill later Saturday, one that did include funding for Ukraine.
Last week, Ukrainian President Volodymyr Zelenskyy visited Capitol Hill to try to convince the slowly growing number of sceptical Republican members of Congress not to give up on his country.