WASHINGTON — Openly welcoming a preordained veto, Republicans drove legislation to Senate passage Thursday aimed at crippling two of their favorite targets: the Affordable Care Act and Planned Parenthood.

With a House rubber stamp expected in days, the bill would be the first to reach President Obama’s desk demolishing the 2010 health care overhaul, one of his proudest domestic achievements, and halting federal payments to Planned Parenthood. Congress has voted dozens of times to repeal or weaken the health care law and several times against Planned Parenthood’s funding, but until now Democrats thwarted Republicans from shipping the legislation to the White House.

Thursday’s vote was a near party-line 52-47.

Sens. Susan Collins of Maine and Mark Kirk of Illinois were the only Republicans to vote no. Maine’s other senator, independent Angus King, also opposed the bill.

Earlier, Collins, Kirk and fellow Republican moderate Lisa Murkowski of Alaska had filed an amendment that to restore the federal funding for Planned Parenthood. It failed on a 48-52 vote.

Republicans said an Obama veto — which the White House has promised — will underscore that a GOP triumph in next year’s presidential and congressional elections would mean repeal of a statute they blame for surging medical costs and insurers abandoning some markets. They lack the two-thirds House and Senate majorities needed to override vetoes, assuring that the bill’s chief purpose will be for campaign talking points.

“President Obama will have a choice,” said Senate Majority Leader Mitch McConnell, R-Ky. “He can defend a status quo that’s failed the middle class by vetoing the bill, or he can work toward a new beginning and better care by signing it.”

King saw the vote in a different light.

“The Affordable Care Act has provided thousands of people in Maine and millions more across the country with affordable, high-quality health insurance,” he said. “Rather than try to take that away, Congress should focus on how we can improve and strengthen the law so that we can extend health insurance to even more people in this country who need it.”

Republicans blame the bill for surging health care costs and insurers abandoning some markets. Government officials said this week that health care spending grew at 5.3 percent in 2014, the steepest climb since Obama took office.

Democrats noted that under the law, millions of people have become insured and said their coverage has improved, with policies now required to insure a wide range of medical services.

“Do they talk to their constituents? Do they meet with them?” Senate Minority Leader Harry Reid, D-Nev., said of Republicans.

With just a 54-46 edge, Republicans had until now been unable to push such legislation through the Senate. This time, they used a special budget procedure that prevents filibusters — delays that take 60 votes to halt — and lets them prevail with 51 votes.

Party leaders initially encountered objections from some more moderate Republicans leery of cutting Planned Parenthood’s funds and from presidential contenders, Sens. Ted Cruz of Texas and Marco Rubio of Florida, who threatened to oppose the measure if it wasn’t strong enough.

In the end, Cruz and Rubio voted “yes.” Collins and Kirk voted no, the only lawmakers to cross party lines, while Democratic presidential candidate Bernie Sanders, I-Vt., didn’t vote.

The Senate bill would all but erase the health care overhaul by dismantling some of its key pillars, such as requirements that most people obtain coverage and larger employers offer it to workers.

Also eliminated would be its expansion of Medicaid coverage to additional lower-income people and the government’s subsidies for many who buy policies on newly created insurance marketplaces, such as HealthCare.gov. And it would end taxes the law imposed to cover its costs, including levies on higher-income people, expensive insurance policies, medical devices and indoor tanning salons.

The bill would also terminate the roughly $450 million yearly in federal dollars that go to Planned Parenthood, about a third of its budget. Federal funds can be used for abortions only in rare cases.

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

“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.”

A perennial target of conservatives, the group has been under intensified GOP pressure this year for its role in providing fetal tissue to scientists. Citing secretly recorded videos of Planned Parenthood officials discussing the practice, some abortion foes have accused the organization of illegally providing the tissue for profit. The group says the videos were deceptively doctored and say it’s done nothing illegal.

As they worked through the bill, senators voted on over a dozen amendments — all symbolic, since the measure was destined to never become law.

They also blocked proposals for tightening gun curbs, a response to Wednesday’s mass shooting in San Bernardino, California, last week’s fatal attack on a Planned Parenthood clinic in Colorado and last month’s terrorist massacre in Paris.

On another, senators voted 90-10 to permanently repeal taxes on high-priced “Cadillac” insurance policies, sending a strong signal of growing congressional momentum for erasing that levy.

GOP lawmakers said the overall bill could serve as a bridge to a future Republican health care law. Though Obama’s overhaul was enacted five years ago, GOP members of Congress have yet to produce a detailed proposal to replace it.

“They’ve never been in a position where they want to change it and fix the law, it’s either repeal or nothing,” Sen. Jon Tester, D-Montana, who heads the Senate Democratic campaign committee, said of the GOP’s failure to propose an alternative health law. “I’ll take that to the polls and we’ll talk about it until the cows come home.”

Republicans argued the voters were on their side.

“We’ve reached a pretty scary time in our nation’s history where we have Americans writing and calling their elected representatives saying they need relief from their own government,” said No. 2 Senate Leader John Cornyn of Texas. “We have a mandate, I believe, to repeal this terrible law.”