Speaker of the House Kevin McCarthy, R-Calif., pauses as he addresses reporters about efforts to pass appropriations bills and avert a looming government shutdown, at the Capitol in Washington, Friday, Sept. 29, 2023. He is joined at right by House Homeland Security Chair Mark Green, R-Tenn., and Rep. Monica de la Cruz, R-Texas. Credit: J. Scott Applewhite / AP

WASHINGTON — On the brink of a federal government shutdown, the House on Saturday swiftly approved a 45-day funding bill to keep federal agencies open as Speaker Kevin McCarthy dropped demands for steep spending cuts and relied on Democratic votes for passage to send the package to the Senate.

The new approach would leave behind aid to Ukraine, a White House priority opposed by a growing number of GOP lawmakers, but the plan would increase federal disaster assistance by $16 billion, meeting President Joe Biden’s full request. The package was approved 335-91, with most Republicans and almost all Democrats supporting.

With hours to go before the midnight deadline to fund the government, the Senate was also in for a rare weekend session and prepared to act next.

“We’re going to do our job,” McCarthy said before the House vote. “We’re going to be adults in the room. And we’re going to keep government open.”

With no deal in place before Sunday, federal workers will face furloughs, more than 2 million active-duty and reserve military troops will work without pay and programs and services that Americans rely on from coast to coast will begin to face shutdown disruptions.

The House measure would fund government at current 2023 levels for 45 days, through Nov. 17, moving closer to the bipartisan approach in the Senate. But the Senate package would have added $6 billion for Ukraine to fight the war against Russia and $6 billion for U.S. disaster relief.

Both chambers came to a standstill as lawmakers assessed their options, some decrying the loss of Ukraine aid.

“The American people deserve better,” said House Democratic leader Hakeem Jeffries of New York, warning in a lengthy floor speech that “extreme” Republicans were risking shutdown.

For the House package to be approved, McCarthy, R-Calif., was forced to rely on Democrats because the speaker’s hard-right flank has said it will oppose any short-term funding measure, denying him the votes needed from his slim majority. It’s a move that risks his job amid calls for his ouster.

After leaving his right-flank behind, McCarthy is almost certain to be facing a motion to try to remove from office, though it is not at all certain there would be enough votes to topple the speaker. Most Republicans voted for the package Saturday while 90 opposed.

“If somebody wants to remove me because I want to be the adult in the room, go ahead and try,” McCarthy said of the threat to oust him. “But I think this country is too important.”

The White House was tracking the developments on Capitol Hill and aides were briefing the president, who was spending the weekend in Washington.

The quick pivot comes after the collapse Friday of McCarthy’s earlier plan to pass a Republican-only bill with steep spending cuts up to 30% to most government agencies that the White House and Democrats rejected as too extreme.

“Our options are slipping away every minute,” said one senior Republican, Rep. Mario Diaz-Balart of Florida.

The federal government is heading straight into a shutdownthat poses grave uncertainty for federal workers in states all across America and the people who depend on them — from troops to border control agents to office workers, scientists and others.

Families that rely on Head Start for children, food benefits and countless other programs large and small are confronting potential interruptions or outright closures. At the airports, Transportation Security Administration officers and air traffic controllers are expected to work without pay, but travelers could face delays in updating their U.S. passports or other travel documents.

An earlier McCarthy plan to keep the government open collapsed Friday due to opposition from a faction of 21 hard-right holdouts despite steep spending cuts of nearly 30% to many agencies and severe border security provisions.

The White House has brushed aside McCarthy’s overtures to meet with Biden after the speaker walked away from the debt deal they brokered earlier this year that set budget levels.

Catering to his hard-right flank, McCarthy had returned to the spending limits the conservatives demanded back in January as part of the deal-making to help him become the House speaker.

After Friday’s vote, McCarthy’s chief Republican critic, Rep. Matt Gaetz of Florida, said the speaker’s bill “went down in flames as I’ve told you all week it would.”

Gaetz has warned he will file a motion calling a vote to oust the speaker.

Some of the Republican holdouts, including Gaetz, are allies of former President Donald Trump, who is Biden’s chief rival in the 2024 race. Trump has been encouraging the Republicans to fight hard for their priorities and even to “shut it down.”

At an early closed-door meeting at the Capitol, several House Republicans, particularly those facing tough reelections next year, urged their colleagues to find a way to prevent a shutdown.

“All of us have a responsibility to lead and to govern,” said Republican Rep. Mike Lawler of New York.

But the lone Democrat to vote against the package, Rep. Mike Quigley of Illinois, the co-chair of the Congressional Ukraine Caucus, called it a victory for Russian President Vladimir Putin and “Putin-sympathizers everywhere.” He said, “Protecting Ukraine is in our national interest.”