Oh yay the government isn’t going to shutdown….

Congress is sending President Obama legislation to prevent a government shutdown following a 277-151 vote in the House that will keep federal agencies funded through Dec. 11.

More Republicans voted against the spending bill than in favor of it, however.

Republicans objected to the inclusion of money for Planned Parenthood in the bill, leading 151 GOP lawmakers to vote against the bill, compared to only 91 who supported it.

Every Democrat voted in favor of the legislation.

The vote also split the GOP lawmakers running for leadership positions in the wake of Speaker John Boehner’s (R-Ohio) surprise announcement last week that he is resigning.

Majority Leader Kevin McCarthy (R-Calif.), the heavy favorite to succeed Boehner, voted yes, as did GOP Whip Steve Scalise (La.), who is running to succeed McCarthy.

But Scalise’s opponent, House Budget Committee Chairman Tom Price (R-Ga.), voted no. So did Rep. Daniel Webster (R-Fla.), McCarthy’s only opponent so far in the Speaker race.

Reps. Pete Sessions (R-Texas) and Dennis Ross (R-Fla.), a deputy whip, who are both running to succeed Scalise, voted no; Rep. Patrick McHenry (R-N.C.), the chief deputy whip, and Rep. Markwayne Mullin (Okla.), two other contenders, voted yes.

The Senate approved the legislation earlier on Wednesday in a 78-20 vote, and Obama is expected to sign it later tonight. All 20 “no” votes in the Senate came from Republicans, though Sens. Marco Rubio (R-Fla.) and Lindsey Graham (R-S.C.), both running for president, missed the vote.

Without action by Congress, the federal government would have shut down on Thursday, the beginning of the new fiscal year.

Before Boehner’s decision to resign, there were real doubts that Congress would be able to act to prevent a shutdown.

Boehner was under pressure to move legislation without federal funding for Planned Parenthood, which has been under attack since the release of videos accusing the group of selling fetal tissue for profit. The group has repeatedly said those charges are unfounded and that the videos are misleading.

Conservatives had warned Boehner they might file a motion to remove him as Speaker if he worked with Democrats to pass the short-term funding bill including Planned Parenthood funds. But once Boehner announced he would step down, conservatives lost their leverage.

In addition, Senate Republicans broadly favored moving the short-term measure even if it included money for Planned Parenthood, as did many House Republicans. They worried that provoking a shutdown would cost the GOP politically.

“We should never shut the government down over that or, frankly, any other issue,” said Rep. Charlie Dent (R-Pa.), a centrist and senior appropriator, said.

The question for Congress now becomes how to prevent a shutdown right before Christmas.