Protesters hold signs and shout at lawmakers walking out of the US Capitol in Washington, DC, on May 4, 2017 after the House of Representatives narrowly passed a Republican effort to repeal and replace Obamacare, delivering a welcome victory to President Donald Trump after early legislative stumbles.

An abortion provision in the Republican health-care bill has set up a Catch-22 for California and New York residents that could leave millions of them ineligible for federal aid to help pay for health insurance.

Both states currently mandate that individual health plans sold in the states cover abortion services.

But the GOP's Obamacare replacement bill would bar federal subsidies from being used to help pay premiums for health plans that offer coverage for abortions in most cases, except for ones involving rape, incest or where the life of the mother is in danger.

"All their state residents may find themselves unable to use the subsidies," said Adam Sonfield, senior policy manager at the Guttmacher Institute, a sexual and reproductive rights organization.

And that would mean that California and New York residents — men as well as women — would "have to pay thousands of dollars extra" for individual health plans because "they would lose that tax credit," Sonfield said.

"So what you end up with is a situation where you're either harming New York and California residents, or the federal government is forcing state governments to change their law," Sonfield said.

"Neither situation is a good situation."

And because individual plans would not cover abortion services if the bill becomes law, female customers of those plans would have to pay for such services totally out of pocket.

The conflict between the bill and the two states' rules led one Republican congressman, rep. Dan Donovan of New York City, to vote against the GOP Obamacare replacement on Thursday.

"As written, the AHCA [American Health Care Act] would impose a tax hike on city residents to fund tax cuts elsewhere in the state," Donovan said on his website. "My constituents would also be unable to use the bill's tax credits because of New York's rules on insurance coverage."

The bill, which passed by a narrow 217 to 213, is now headed for consideration in the Senate, where it faces likely alteration.

"They are states that strongly ... support abortion access," Salganicoff said.

Obamacare premium tax credits, which can only be applied to plans sold through government-run marketplaces such as HealthCare.gov, cannot be used now to pay for abortion services, Salganicoff noted. But people who receive such aid can pay a surcharge for insurance plans that cover the cost of abortion services, she said.

However, Obamacare lets states decide whether to ban plans that offer abortion coverage from being sold on government-run insurance exchanges.

Twenty-five states had decided to ban abortion coverage through the marketplaces' plans, Salganicoff said.

"Ten of those states also banned abortion coverage through their individual market," Salganicoff said.

In other words, in those states no individual health plan can be sold, either on the Obamacare exchanges or outside of them, that cover abortions.

Unlike Obamacare, which limits the subsidies to customers of exchange-sold plans, the GOP's health-care bill would offer premium subsidies to people who buy individual plans either on the exchanges or outside of them.

But the provision in the bill would bar the subsidies from being used for plans that cover abortions, regardless of whether the plans are sold on or off the exchange.

"What's interesting is that a lot of the language and the support that the Republicans have generated is that they want to give more choice to the states to [design] their own benefits, and the AHCA sets up waivers to do that," Salganicoff said.

"But in the case of abortion, they specifically say that they must be excluded, and it would no longer give the states the option to include abortion" for plans eligible for subsidies, she said.

Salganicoff said that inclusion of the abortion provision in the bill reflects the fact that "restricting abortion is a priority for the Republican Congress and the Trump administration."