A band of House conservatives Friday voted down a GOP bill to avoid a government shutdown.

The vote marked a significant — and embarrassing — defeat for Speaker Kevin McCarthy (R-Calif.) as a shutdown this weekend appears increasingly inevitable.

More than 20 Republicans joined Democrats in opposing the legislation, bringing the final tally to 232-198.

The 21 GOP lawmakers who voted against the bill were: Reps. Andy Biggs (Ariz.), Dan Bishop (N.C.), Lauren Boebert (Colo.), Ken Buck (Colo.), Tim Burchett (Tenn.), Eric Burlison (Mo.), Michael Cloud (Texas), Eli Crane (Ariz.), Matt Gaetz (Fla.), Paul Gosar (Ariz.), Marjorie Taylor Greene (Ga.), Wesley Hunt (Texas), Nancy Mace (S.C.), Mary Miller (Ill.), Cory Mills (Fla.), Alex Mooney (W.Va.), Barry Moore (Ala.), Troy Nehls (Texas), Andy Ogles (Tenn.), Matt Rosendale (Mont.) and Keith Self (Texas).

The measure advanced in a party-line vote earlier Friday.

The bill did not stand a chance in the Senate, where Democrats were sure to line up against it. And the White House Friday morning issued a veto threat for the bill.

The tally was largely expected after a handful of conservatives — more than McCarthy could afford to lose in his narrow majority — lined up against the measure.

But the failed vote, nonetheless, marks a setback for McCarthy, who has pushed his GOP colleagues to clear a partisan stopgap bill so his conference could have greater leverage in funding negotiations with Democrats in the Senate and the White House.

And it increases the odds of a government shutdown, which will go into effect Saturday night unless Congress passes a short-term funding bill by then.

Republicans quickly vented frustration with the hard-liners who voted against the bill.

“There are 21 Republicans who just voted to defund the United States military and keep the border open. … They need to be called out by name,” he said. “I mean, this is not a Republican shutdown. This is a shutdown – If we don’t get this done soon – that is caused by 21 individual members of the Republican conference,” Rep. Derrick Van Orden (Wis.) said.

Moderate Rep. Mike Lawler (R-N.Y.) placed the blame directly on one lawmaker.

“There’s only one person to blame for any potential government shutdown, and that’s Matt Gaetz. He’s not a conservative Republican. He’s a charlatan,” Lawler said.

There is no clear path on the table to prevent a lapse in funding.

The Senate is moving ahead with a bipartisan continuing resolution that that McCarthy told his members earlier this week he will not bring to the floor. A number of conservatives have voiced concerns about the Ukraine aid in the bill and the lack of border security provisions.

McCarthy, for his part, has consistently said he does not want the government to shut down, arguing that a lapse in funding is not beneficial for anybody.

“The No. 1 thing I want here is for government not to shut down,” McCarthy said at a press conference ahead of the vote.

The House GOP stopgap bill, which leaders released Friday morning, called for extending funding until Oct. 31 while imposing across-the-board cuts of roughly 30 percent, with exceptions for national defense, the Department of Veterans Affairs, the Department of Homeland Security and funding for disaster relief. It also included a large part of the conference’s marquee border bill, H.R. 2, which would boost southern border wall construction, the hiring of border agents and restrict access to asylum, among other provisions.

Additionally, the legislation called for the creation of a fiscal commission to recognize solutions to attain what was dubbed a “sustainable debt-to-GDP ratio” and to balance the federal budget.

McCarthy in recent days has leaned into messaging focused on approving border provisions within the stopgap, questioning why conservative holdouts would want to side with Democrats on the hot-button topic.

“I can’t understand why someone would side with President Biden on keeping the border open,” McCarthy said Friday.

Democrats, for their part, have slammed the spending cuts and policy provisions included in the GOP stopgap.

“A 30 percent slashing of the federal government only ‘continues’ the majority’s inability and unwillingness to govern responsibly,” Rep. Rosa DeLauro (Conn.), the top Democrat on the Appropriations Committee, said on the House floor Friday. “I would argue you cannot call it a ‘conservative’ resolution either — there is nothing conservative about the indiscriminate destruction of public investments in America’s families.”

“But regardless of what it is called, this bill inflicts serious consequences on the American people — whether it is signed into law, which it never will be, or because of the costly shutdown it triggers,” she added.

Despite the setback, McCarthy suggested Friday that he does not plan to give up on keeping the lights on in Washington. Asked if the GOP stopgap bill was the House’s last chance at averting a shutdown, the Speaker delivered a familiar message.

“You have watched me time and again, have you ever known me to quit after one time if it doesn’t succeed?” the Speaker asked reporters. “I don’t stop.”

Leaving the chamber after the failed vote, he said his strategy is to “keep going.”

Emily Brooks contributed. Updated at 2:43 p.m.