The bill, which has some exceptions for rape, incest and the life of the mother, will go into effect immediately if the governor signs it.

West Virginia on Tuesday became the latest state to pass a near-total ban on abortion, with the two chambers of the Legislature reaching a compromise after deadlocking on the terms earlier this summer.

During a special session in July, the House and Senate disagreed in particular on whether abortion providers should face jail time. But in another special session that began this week, the Republican-dominated Legislature voted overwhelmingly for an amended version that would make abortions illegal in nearly all circumstances, with the exception of medical emergencies that put the mother’s life at risk or, if certain conditions were met, in cases of rape or incest.

With the roar of protesters occasionally echoing outside — and at times within — the two chambers, the Senate passed an amended version of the earlier bill with about three-quarters support and then adjourned. Several hours later, the House passed it by an even larger margin. Gov. Jim Justice, a Republican, was expected to sign the bill into law, which would go into effect immediately afterward.

Since the Supreme Court struck down Roe v. Wade in June, ending the constitutional right to an abortion, so-called trigger laws passed in anticipation of the ruling have gone into effect; abortion has been banned or severely restricted in 14 states. But West Virginia is only the second state, after Indiana, to pass a new ban since the ruling. Other states have tried, but their attempts have failed or are stalled.

Under the bill passed in West Virginia on Tuesday, an abortion in the case of sexual assault or incest would be permissible in the first eight weeks of pregnancy if the assault had been reported to law enforcement. For minors, abortion would be permissible up to 14 weeks of pregnancy in the case of rape or incest, provided that the assault had been reported to law enforcement or the victim had sought treatment at a West Virginia hospital.

In the hours of debate leading up to the amended bill’s passage, the small minority of lawmakers who opposed it said the exceptions were so narrow as to be “illusory” and “marketing.”

The Legislature’s earlier attempt to ban most abortions largely fell apart on the question of penalties, with the Senate and House disagreeing on whether medical professionals who perform illegal abortions should be subject to criminal charges. The amended Senate bill, which was introduced by Dr. Tom Takubo, an osteopathic physician and the majority leader, narrowed who can perform abortions in the few cases where they will still be allowed.

Only medical doctors and osteopaths with admitting privileges at West Virginia hospitals would be allowed to perform abortions, and if they were found to have violated the law, they could lose their medical licenses. Anyone else who provided an abortion could face criminal penalties and possibly jail time.

Chris Dorst/Charleston Gazette-Mail, via Associated Press

West Virginia already had a law on its books older than the state itself that made it a felony to perform an abortion, with a mandatory prison sentence of three to 10 years. After the Supreme Court decision, however, it was unclear whether that law could go into effect.

When a state judge blocked enforcement of the old ban in July, saying that a number of recent abortion restrictions passed by the Legislature conflicted with it, she allowed abortions to proceed in the sole clinic that offers them. The clinic, in Charleston, had suspended abortion services on June 24, the day of the Supreme Court decision.

Days later, Mr. Justice called on state lawmakers to “clarify and modernize” the old ban in a special legislative session in July. Opponents and proponents of abortion rights flocked to the State Capitol, and dozens spoke at a public hearing — most of them, including a 12-year-old girl, arguing against a ban. The Republican majorities in the House of Delegates and the Senate went on to pass versions of near-total bans, but lawmakers from the two chambers could not reach an agreement.

Critics, including members of the Legislature’s Democratic minority, said that making it a crime to perform an abortion in most cases would only exacerbate what already was a serious shortage of health care providers in West Virginia. The version that passed in the new special session, which does not include criminal penalties for physicians, did not assuage those concerns.

“As we all know, it is hard to recruit obstetrics and gynecologists to West Virginia; we have what we call maternity deserts,” Dr. Ron Stollings, a Democratic state senator, said during the debate in the Senate. “I’ve even had one husband-and-wife team tell me that if this bill passes, where they could lose their license for misinterpreting a medical emergency, as soon as their youngest daughter is out of high school, they’re hitting the trail.”

Original Source