(Bloomberg) -- President Joe Biden on Friday signed a short-term spending bill, which includes $12 billion in aid to Ukraine as well as US disaster relief, hours before a midnight deadline that would have shut down much of the government.

The stopgap bill, approved by the US House earlier in the day and by the Senate on Thursday, will finance the government until Dec. 16. 

The measure’s passage buys lawmakers time until after the November midterm elections. But Republican opposition in the House forecasts potential turmoil when the legislation expires, especially if the GOP wins control of one or both chambers. 

Republicans said they had no role in crafting the measure and wanted a stopgap bill that extended into next year instead. Forecasts favor Republicans taking the majority in the House in January and a longer stopgap would have given the party more say in any final 2023 spending decisions. 

Republicans want to cut funding for Internal Revenue Service tax audits and to provide more money for immigration enforcement. 

“They did not ask for any new money for border patrol agents to address this Biden-created crisis on the southern border,” said Representative Tom Cole, an Oklahoma Republican, in a floor speech opposing the bill. 

Democrats said the GOP opposition reflects a cavalier attitude toward government shutdowns that led to the longest closure of the federal government in history in 2018 and 2019 when President Donald Trump and the GOP tried to use a 35-day shutdown to force Democrats to accept funding for a wall on the southern border. 

“We think it is unacceptable to ever shut the government down,” Massachusetts Democrat Jim McGovern said. 

The measure also includes $2 billion in disaster relief, $2.5 billion for New Mexico wildfires and $1 billion in home heating assistance. Language in the bill allows the Federal Emergency Management Agency to access about $35 billion in disaster relief funds that should speed aid to victims of Hurricane Ian. 

The bill extends Food and Drug Administration user fees for five years, averting a planned layoff. 

The path was cleared for Senate passage of the bill after Senate Majority Leader Chuck Schumer and West Virginia Democrat Joe Manchin dropped an effort to include a proposal to ease the permit process for energy projects. 

Manchin was unable to assemble 60 votes for his energy permit changes in the face of opposition in both parties. Manchin told reporters he plans to try to negotiate with Republicans to revive a new version of his bill for possible inclusion in an annual defense policy bill coming to the Senate floor after the election. 

At the request of Republicans, $27 billion in funding requested by the White House to fight the coronavirus and the monkeypox outbreak was also excluded. 

A stopgap measure is needed to keep the government running past the Oct. 1 start of the fiscal year because Congress has failed to pass any of the 12 annual spending bills for fiscal 2023. The House passed six bills and the Senate took up none of them. 

Friday’s votes were the last the House plans to conduct before the November midterms. 

©2022 Bloomberg L.P.