Speaker John Boehner watched his hard-fought bill go down in instant defeat in the Senate Monday night, leaving him with just a few hours to rally his conference around a plan that will keep the government open.

It won’t be easy.

A dozen Republicans voted against his last plan, which would have kept the government open in exchange for some changes to Obamacare. And prominent Republicans like Sen. Rand Paul are starting to talk about a temporary fix that would at least avert a shutdown at midnight. Others, like Rep. Thomas Massie of Kentucky are predicting Republicans will lose even as they urge Boehner to keep up the fight.

So while Boehner eked out a victory, moderates and conservatives alike are starting to rebel, leaving Boehner exposed on the left and the right just as he is supposed to show strength in the final hours before a shutdown. It means Boehner is heading into the final hours of a battle against a united Democratic front hobbled by an ugly civil war raging in his party.

On Boehner’s left flank, moderate Republicans who have long warned against a confrontation over Obamacare are arguing that this may be the stop on the shutdown train where they get off.

Congressman Peter King of New York, who supported the House’s previous bill to delay Obamacare, said he planned to vote against the new measure. Not only that, he predicted to MSNBC’s Luke Russert that as many as two dozen more moderate Republicans could join him in opposing the “Ted Cruz wing.”

“I can tell you about 25 people on Saturday night who told me they were definitely going to vote no,” he said. “Now, at high noon you don’t how many of that 25 are going to stay committed, but there’s real opposition.”

Moderate Republican Charlie Dent of Pennsylvania also called on Boehner to accede to Obama’s demands and offer a clean continuing resolution.

“The hour glass is already empty and it’s time that we pass a clean CR,” he told reporters.

Dent and King rebelled against a test vote on the rules governing the debate of over the bill Monday night, but they were it for the moderate caucus. They didn’t do much better in the final vote, either. But some supporters of the bill said their patience was running thin with brinksmanship.

Devin Nunes of California told reporters he was voting for the bill, but that the House GOP was acting “like lemmings with suicide vests” intent on provoking a crisis with unrealistic demands.

“They have to be more than just a lemming,” he said of the House’s conservative wing. “Because jumping to your death is not enough.”

On the right, tea party rabble rousers like Rep. Michele Bachmann of Minnesota opposed the latest bill because it doesn’t go far enough in opposing Obamacare.

“For what I have done with my life as a federal tax lawyer, I wouldn’t negotiate with myself, because then I wouldn’t have a strong position,” Bachmann told reporters. “It’s important we come at this with strength.”

On the rules vote for the bill Bachmann voted nay along with three other tea party Republicans: Steve King, Paul Broun, and Louie Gohmert.

They were joined in the final vote by Joe Barton, Mario Diaz Balart, Phil Gingrey, Kay Granger, Thomas Massie, and Mike Rogers.

“We’re just rushing to the clean CR,” Massie, who voted against Boehner’s proposal because it was too weak on Obamacare, told reporters. “That’s where we’re going to end.”

Boehner can only afford to lose 16 Republicans votes, give or take a handful of Democrats who might cross over. If at any point one of his bills fail, it will severely damage his leverage by demonstrating his caucus is too divided to even reach a consensus starting point on negotiations.

A similar revolt during the 2012 fiscal cliff fight over the Bush tax cuts and sequestration ended with Boehner asking the Senate to reach a compromise instead, which he then passed over conservative objections with help from Democrats in the House. In this case, the damage would be greater as Democrats would likely assume Boehner’s position was compromised on the debt ceiling as well. After all, if moderates and conservatives revolt when a shutdown deadline gets close, why wouldn’t they do the same thing for the far more dangerous default deadline?