The US Congress approved $12.3 billion in aid Friday to help Ukraine battle its invasion by Russia as part of a stopgap spending bill that averts a chaotic government shutdown ahead of a midnight deadline.

The package includes $3 billion for arms, supplies and salaries for Ukraine's military and authorizes President Joe Biden to direct the Pentagon to transfer $3.7 billion in weapons and other hardware to Ukraine.

The so-called "continuing resolution" -- passed by 230 votes to 201, with 10 Republicans joining the Democrats -- also provides $4.5 billion for Kyiv to keep the country's finances stable and keep the government running.

The allocation takes the US contribution to the war effort to $65 billion. It was approved just hours after Russian President Vladimir Putin annexed four Moscow-occupied Ukrainian regions, in defiance of warnings from the West.

"This new grant assistance is a further demonstration of US confidence in Ukraine and will support critical government operations and provide relief to Ukrainian people suffering under Russia's brutal war," Treasury Secretary Janet Yellen said in a statement.

"Critically, this funding will also help bolster Ukraine's valiant resistance to Putin's illegal war of aggression. We call on fellow donors to not only speed up their existing disbursements to Ukraine, but also to increase their scale of assistance."

Government shutdowns threaten the finances of hundreds of thousands of workers who risk being sent home without pay as parks, museums and other federal properties close.

The stopgap measure, which keeps federal agencies open until December 16, cleared the Senate Thursday by a comfortable 72 votes to 25.

It includes $1 billion in winter fuel allowance for low-income families, $20 million for a clean water crisis in Jackson, Mississippi, and billions in disaster aid for various states.

Its passage was unusually light on drama this time around, with lawmakers keen to skip town and get back to the campaign trail ahead of midterm Election Day on November 8.

A proposal attached to the package to speed up the approval process for large energy projects provided the only controversy.

But its author Joe Manchin, a Democrat with extensive interests in the fossil fuel industry, agreed to drop the text after conceding it didn't have the support and risked sinking the entire package.

Lawmakers rejected a request by the White House for billions of dollars for the nation's Covid-19 and monkeypox response, amid staunch Republican opposition.

The president last week declared the pandemic "over," easing the path for Republicans to reject the request.