Sen. Susan Collins’ effort to preserve federal funding for hundreds of Planned Parenthood programs across the country, including four women’s health care clinics in Maine, got swept away in a tidal wave of Republican support for legislation that would abolish President Obama’s Affordable Care Act.

The bill, which was adopted Thursday by the Senate but is certain to be vetoed by Obama, also contains a provision that defunds all federal assistance to the nation’s largest women’s health care organization. Collins, a Republican, broke ranks with her party to vote against the bill, which passed 52-47. Sen. Mark Kirk of Illinois was the only other Republican to do so. Maine’s other senator, independent Angus King, also opposed the measure.

Both Maine senators said the bill unfairly targets Planned Parenthood, which operates hundreds of clinics across the country.

Under the bill, Planned Parenthood of Northern New England would not receive federal assistance for its 21 clinics, including those in Biddeford, Sanford, Portland and Topsham. Its 17 other offices are in Vermont and New Hampshire.

Collins, who felt the Republican-backed measure went too far, joined with Kirk and fellow Republican moderate Lisa Murkowski of Alaska on Thursday to sponsor an amendment that would have preserved federal funding for Planned Parenthood organizations.

The amendment failed by a 48-52 vote, needing 51 votes to pass.

It would have stricken the provisions aimed at eliminating federal funding, including Medicaid reimbursements for Planned Parenthood. Collins said her amendment would have prohibited the use of federal funds for abortions, except in the cases of rape, incest or where the life of the mother is considered at risk.

Collins spokeswoman Annie Clark said that Collins is concerned that defunding Planned Parenthood would force the majority of clinics to close, which would impact the ability of women in Maine and across the country to access needed health care.

“Collins has consistently opposed defunding Planned Parenthood because it provides important family planning, cancer screenings, and basic preventive health care services for millions of women across the country,” Clark said. “For many women, Planned Parenthood clinics provide the only health care services they receive.”

In July, Senate Republicans, including Majority Leader Mitch McConnell of Kentucky, introduced legislation to cut off all federal funds to Planned Parenthood. Their bill would have stripped about $540 million in funding for the women’s health services organization.

The legislation was proposed after secretly obtained video footage from a California-based anti-abortion group became public. The videos showed representatives from Planned Parenthood discussing fetal tissue sales.

Collins, who said she was “sickened” by the videos, in August proposed a targeted approach that would have preserved federal funding for nearly all the Planned Parenthood offices in the United States, including Maine, but which also called for the Department of Justice to investigate a handful of offices that anti-abortion groups alleged were selling fetal tissue.

Collins’ bill didn’t gain support, and the bill backed by McConnell to cut off all funding was eventually defeated 52-47.

Collins and King both voted against the so-called Budget Reconciliation Act on Thursday night and both senators issued statements denouncing the Senate’s decision to defund Planned Parenthood.

“While I do support the ongoing effort to repeal and replace Obamacare, the inclusion of these harmful Planned Parenthood provisions had no place in this legislation,” Collins said.

Collins also addressed the videos that were released over the summer.

“I know that many Americans, including me, were appalled by the actions of some Planned Parenthood employees who were shown discussing the sale of fetal tissue,” Collins said. “But the fact remains that only a very small percentage of Planned Parenthood facilities – only seven of more than 700 – were engaged in the sale of fetal tissue, and now no Planned Parenthood clinic is involved in these sales. Despite the sickening nature of these videos, it would be unfair and unwise to respond by shutting down the main source of basic health care for millions of women.”

King voted in favor of Collins’ amendment and voted against repealing the Affordable Care Act.

“To strip Planned Parenthood of federal funding is to deny millions of women and men basic health care services, many of whom are low-income and rely on the organization as their sole health care provider,” King said in a statement released Thursday evening. “Congress’s unfounded yet relentless assault on Planned Parenthood is simply another example of misguided outrage that would only hurt those who need help the most.”

Planned Parenthood of Northern New England spokeswoman Nicole Clegg issued a statement saying the organization is thankful to Collins for “standing with the women, men and young people of Maine who rely on the critical preventive services that we provide.”

Clegg said the clinics in Maine provide breast and cervical cancer screenings, birth control and STD tests.

In Maine last year, Planned Parenthood provided health care to more than 10,000 patients, including $3.5 million in free or discounted care.

“With 66 percent of patients earning incomes below $17,505, Planned Parenthood is a critical component of the state’s health care safety net,” Clegg said. “And thanks in large part to the work of Planned Parenthood, unintended pregnancy and abortion rates have declined significantly in Maine, saving the state millions in taxpayer dollars.”