(Bloomberg) -- The Oklahoma Supreme Court on Wednesday struck down two state laws that effectively banned abortions after a certain point in pregnancy by empowering private citizens to sue doctors, though the procedure remains illegal in most cases under a separate law.

In a 6-3 opinion, the court ruled two laws passed in 2022 are unconstitutional because they only allow doctors to perform abortions in limited circumstances. A March ruling from the court found that women in the state have the right to have an abortion “when necessary to preserve her life.”

Still, abortion remains illegal in Oklahoma, where a law the state legislature adopted after the US Supreme Court overturned the landmark Roe v. Wade made it a felony to perform the procedure, punishable by as long  as 10 years in prison. 

Before federal abortion rights were overturned, Republican lawmakers in Oklahoma had passed two measures that mirrored a unique civil enforcement mechanism used in Texas. To avoid running afoul of the federal court precedent at the time, Oklahoma and Texas used the threat of costly citizen lawsuits to discourage doctors from performing the procedure.

Abortion rights advocates who sued Oklahoma over those laws celebrated Wednesday’s decision as a victory, saying it affirms the rights of women in the state.

“Today, the Oklahoma Supreme Court reiterated that the state constitution protects the right to abortion in life-threatening situations,” said Nancy Northup, president and chief executive officer of the Center for Reproductive Rights. “It’s time Oklahoma lawmakers stop violating their own constitution and putting lives at risk.”

The case is Oklahoma Call for Reproductive Justice v. Oklahoma, 2023 OK 60, Oklahoma Supreme Court.

©2023 Bloomberg L.P.