Two moderate Senate Democrats split from their party Monday and voted to defund Planned Parenthood, while two others decided to oppose the measure being pushed by Republicans.

Two prominent moderates, Sens. Joe Manchin (D-W.Va.) and Joe Donnelly (D-Ind.), sided with Republicans on the controversial measure. Two others who were considered to be likely swing voters, Sens. Bob Casey (D-Pa.) and Heidi Heitkamp (D-N.D.), voted against the bill, joining 43 other Democrats and Republican Sen. Mark Kirk of Illinois to defeat the measure.

[Sign up for The Daily 202, The Washington Post’s new political tipsheet]

Both Manchin and Donnelly, moderate Democrats from conservative states, said they could not support federal funding for Planned Parenthood while questions remain about the legality of the group’s actions.

Ultimately they both decided to buck party leaders and President Obama.

“Until these allegations have been answered and resolved, I do not believe that taxpayer money should be used to fund this organization,” Manchin said in a statement. “Instead, those funds should be sent to other health-care providers, including community health centers, which provide important women’s health-care services.”

Manchin was referring to a series of undercover videos released by an antiabortion group known as the Center for Medical Progress. The group has released several edited videos that show excerpts of conversations with Planned Parenthood staff members graphically discussing abortion methods and the process for providing fetal tissue for medical research.

It has been clear for days that Republicans are likely to fall far short of the 60 votes needed to overcome a filibuster Monday night, leaving undecided senators the chance to vote without swaying the outcome. Aides said there was no formal effort by Senate Democratic leaders to sway undecided senators in either direction. The vote comes days before lawmakers leave Washington for a long recess, a time when many if not all return to their home states to face voters directly.

Casey, a long-time abortion foe, joined the majority of Senate Democrats in backing Planned Parenthood on the grounds that federal funds support only family planning and health-care services that are unrelated to abortion.

“I will continue to support Title X  funding for family planning and contraception, including funds that go to Planned Parenthood, because these programs reduce unintended pregnancies and, as a result, reduce the number of abortions,” Casey said.

“Planned Parenthood facilities provide vital services, like cervical and breast cancer screenings and primary health care, to millions of low-income women, and it’s important that those services continue.”

The vote also created a difficult choice for moderate Republicans, including Sens. Mark Kirk (R-Ill.), Susan Collins (R-Maine) and Lisa Murkowski (R-Alaska). Collins ultimately decided that she will vote for the bill in hopes of passing an amendment to refine and more clearly redirect the funds that would be cut from Planned Parenthood.

Kirk was the only Republican to vote against defunding the group.

Planned Parenthood and other abortion providers are barred from using federal funds to pay for abortions, but the group receives grants and Medicaid reimbursement for other health services such as  family planning and cancer screenings. The Republican-backed bill would bar the group from receiving those funds and would allow future legislation to redirect the money to unspecified community health programs.

More than a third of Planned Parenthood’s $1.3 billion in revenue last year came from government sources, and Republicans say that community health centers and other providers will be able to accommodate the roughly 2.7 million clients served at roughly 700 clinics.