WASHINGTON (AP) — Republican legislation letting states deny federal family planning money to Planned Parenthood and other abortion providers squeezed narrowly through the Senate Thursday, rescued by an ailing GOP senator who returned to the Capitol after back surgery and a tie-breaking vote by Vice President Mike Pence.

In Congress' latest clash mixing the politics of abortion, women's health and states' rights, Pence cast the decisive vote in a 51-50 roll call. The tally had been tied after two GOP senators, Alaska's Lisa Murkowski and Maine's Susan Collins, joined Democrats opposing the measure.

Senate approval sent the legislation to President Donald Trump, who was expected to sign it. The House voted its consent last month.

The bill erases a regulation imposed by former President Barack Obama shortly before he left office that lets states deny family planning funds to organizations only if they are incapable of providing those services. Some states have passed laws in recent years denying the money to groups that provide abortions.

Passage gives Republicans and anti-abortion groups a needed victory just six days after the party's highly touted health care overhaul disintegrated in the House due to GOP divisions. Besides erasing much of Obama's 2010 health care law, the failed House bill would have blocked federal funds for Planned Parenthood for a year.

There is already a ban on using federal funds for abortion except for rare instances.

Democrats assailed the legislation as an attack on women, two months after Trump's inauguration prompted a women's march on Washington that mushroomed into anti-Trump demonstrations around the nation.

"While Trumpcare was dealt a significant blow last week, it is clear that the terrible ideas that underpin it live on with Republicans in Congress," said Sen. Patty Murray, D-Wash., using a nickname for the failed House health care bill. Murray, among a stream of Democratic women senators who spoke, called the Senate measure "shameful" and "dangerous."

Republicans said the measure would let states divert money now going to groups that provide abortion to organizations that don't, like community health centers.

With Republicans controlling the Senate 52-48, the Collins and Murkowski defections could have derailed the bill because Sen. Johnny Isakson, R-Ga., has been absent since he had spinal surgery Feb. 20.

He had a second operation March 15 and has been recuperating in Georgia under doctor's orders. But he got permission to return to Washington for one day, his office said, and he did so using a walker.

"We didn't know at the time what it would be but it turned out to be the vice president's tie-breaker," Isakson told reporters after an earlier procedural vote.

The federal family planning program was created 1970, and in 2015 served 4 million clients at nearly 4,000 clinics. Most of the money is for providing services like contraceptives, family planning counseling, breast and cervical cancer screening and sexually transmitted disease prevention. It has a $286 million federal budget this year.

Most recipients are women, and two-thirds have incomes at or below the federal poverty level, around $12,000 for an individual. Six in 10 say the program's services are their only or most frequent source of health care.

"Mike Pence went from yesterday's forum on empowering women to today leading a group of male politicians in a vote to take away access to birth control and cancer screenings," she said.

Timothy Head, executive director of the conservative Faith & Freedom Coalition, hailed lawmakers for taking "the first step to stopping taxpayer subsidizing of the largest abortion provider" in the country.

The Congressional Review Act has lets lawmakers undo regulations enacted in the last months of the Obama administration with a majority vote. Congress has already used the law to eliminate Obama regulations dealing with pollution from coal mining operations and prevented some people with mental disorders from gun purchases.

Under the Constitution, the vice president casts tie breaking votes. Pence broke his first tie on the nomination of Education Secretary Betsy DeVos.

The Associated Press is an American multinational nonprofit news agency headquartered in New York City. The AP is owned by its contributing newspapers, radio, and television stations in the United States, all of which contribute stories to the AP and use material written by its staff journalists.

The Congressional Budget Office says the health care bill Republicans pushed through the House would leave 23 million additional people uninsured in 2026 compared to President Barack Obama's health care law

Corrections officials say four inmates remained hospitalized with gunshot wounds Thursday, a day after California correctional officers opened fire to quell a rare mass attack on eight prison guards by more than 100 inmates

A medicine made from marijuana, without the stuff that gives a high, cut seizures in kids with a severe form of epilepsy in a study that strengthens the case for more research into pot's possible health benefits