WASHINGTON (AP) — House Speaker Kevin McCarthy’s last-ditch plan to keep the federal government temporarily open collapsed in dramatic fashion Friday as a robust faction of hard-right holdouts rejected the package, making a shutdown almost certain.

McCarthy’s right-flank Republicans refused to support the bill despite its steep spending cuts of nearly 30% to many agencies and severe border security provisions, calling it insufficient.

The White House and Democrats rejected the Republican approach as too extreme. The vote was 198-232, with 21 hard-right Republicans voting to sink the package. The Democrats voted against it.

The bill’s complete failure a day before Saturday’s deadline to fund the government leaves few options to prevent a shutdown that will furlough federal workers, keep the military working without pay and disrupt programs and services for millions of Americans.

A clearly agitated McCarthy left the House chamber. “It’s not the end yet; I’ve got other ideas,” he told reporters.

The outcome puts McCarthy’s speakership in serious jeopardy with almost no political leverage to lead the House at a critical moment that has pushed the government into crisis. Even the failed plan, an extraordinary concession to immediately slash spending by one-third for many agencies, was not enough to satisfy the hard-right flank that has upturned his speakership.

The federal government is heading straight into a shutdown after midnight Saturday that would leave 2 million military troops without pay, furlough federal workers and disrupt government services and programs that Americans rely on from coast to coast. Congress has been unable to fund the agencies or pass a temporary bill to keep offices open.

The Senate was pushing ahead Friday with its own plan favored by Republicans and Democrats to keep the government open while also bolstering Ukraine aid and U.S. disaster accounts. But that won’t matter with the House in political chaos.

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

“Extreme House Republicans are now tripling down on their demands to eviscerate programs millions of hardworking families count on,” White House press secretary Karine Jean-Pierre said.

Jean-Pierre said, “The path forward to fund the government has been laid out by the Senate with bipartisan support — House Republicans just need to take it.”

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.

His package would not have cut the Defense, Veterans or Homeland Security departments but would have slashed almost all other agencies by up to 30% — steep hits to a vast array of programs, services and departments Americans routinely depend on.

It also added strict new border security provisions that would kickstart building the wall at the southern border with Mexico, among other measures. Additionally, the package would have set up a bipartisan debt commission to address the nation’s mounting debt load.

Ahead of voting, the Republican speaker all but dared his holdout colleagues to oppose the package a day before Saturday’s almost certain shutdown. The House bill would have kept operations open through Oct. 31.

“Every member will have to go on record where they stand,” McCarthy said.

Asked if he had the votes, McCarthy said, “We’ll see.”

But as soon as the floor debate began, McCarthy’s chief Republican critic, Rep. Matt Gaetz of Florida, announced he would be voting against the package, urging his colleagues to “not surrender.”

The hard right, led by Gaetz, has been threatening McCarthy’s ouster, with a looming vote to try to remove him from the speaker’s office unless he meets the conservative demands. Still, it’s unclear if any other Republican would have support from the House majority to lead the party.

Gaetz said afterward that the speaker’s bill “went down in flames as I’ve told you all week it would.”

He and others rejecting the temporary measure want the House to instead keep pushing through the 12 individual spending bills needed to fund the government, typically a weeks-long process, as they pursue their conservative priorities.

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

The margin of defeat shocked even Republican members.

Rep. Mike Garcia, R-Calif., said: “I think what this does, if anything, I think it’s going to rally people around the speaker and go: ‘Hey, the dysfunction here is not coming from leadership in this case. The dysfunction is coming from individuals that don’t understand the implications of what we’re doing here.’”

Garcia said, “For the people that claim this isn’t good enough, I want to hear what good enough looks like.”

Another Republican, Rep. Ralph Norman of South Carolina, a member of the Freedom Caucus who supported the package, suggested the House was losing its leverage with the failed vote: “We control the purse strings. We just ceded them to the Senate.”

Republicans convened for a closed-door meeting later Friday afternoon that grew heated, lawmakers said, but failed to produce a new plan. Leaders announced the House would stay in session next week, rather than return home, to keep working on some of the 12 spending bills.

Rep. Rosa DeLauro of Connecticut, the top Democrat on the Appropriations Committee, criticized the proposed Republican cuts as hurting law enforcement and education and taking food out of the mouths of millions. She said 275,000 children would lose access to Head Start, making it harder for parents to work.

“This is a pointless charade with grave consequences for the American people,” DeLauro said.