A divided Oklahoma Supreme Court on Tuesday overturned a portion of the state’s near total ban on abortion, ruling women have a right to abortion when pregnancy risks their health, not just in a medical emergency.

It was a narrow win for abortion rights advocates since the U.S. Supreme Court struck down Roe v. Wade.

The court ruled that a woman has the right under the state Constitution to receive an abortion to preserve her life if her doctor determines that continuing the pregnancy would endanger it due to a condition she has or is likely to develop during the pregnancy. Previously, the right to an abortion could only take place in the case of medical emergency.

OKLAHOMA GOVERNOR SIGNS TEXAS-STYLE ABORTION BAN INTO LAW

"Requiring one to wait until there is a medical emergency would further endanger the life of the pregnant woman and does not serve a compelling state interest," the ruling states.

In the 5-4 ruling, the court said the state law uses both the words "preserve" and "save" the mother’s life as an exception to the abortion ban.

"The language ‘except to save the life of a pregnant woman in a medical emergency’ is much different from ‘preserve her life,’" according to the ruling.

"Absolute certainty," by the physician that the mother's life could be endangered, "is not required, however, mere possibility or speculation is insufficient" to determine that an abortion is needed to preserve the woman’s life, according to the ruling.

Oklahoma abortion protest

Pro-abortion protestors are seen rallying outside the Oklahoma State Capitol. The state's high court on Tuesday authorized exceptions to its strict, Texas-style abortion law for pregnancies that threaten mothers' lives. (AP Photo/Sue Ogrocki, File)

The court, however, declined to rule on whether the state Constitution grants the right to an abortion for other reasons.

The court ruled in the lawsuit filed by Planned Parenthood, Tulsa Women's Reproductive Clinic and others challenging the state laws passed after the U.S. Supreme Court overturned the landmark Roe v. Wade decision that legalized abortion.

"People’s lives have been endangered by Oklahoma’s cruel abortion bans, and now doctors will be able to help pregnant people whose lives they believe are at risk," Nancy Northup, President and CEO of the Center for Reproductive Rights, said in a statement after the ruling.

OKLAHOMA ABORTION LAW PROTECTING LIFE FROM CONCEPTION TO FACE LEGAL CHALLENGE FROM PLANNED PARENTHOOD

"We are disappointed that the Court declined to rule whether the state Constitution also protects the right to abortion outside of these circumstances," Northrup said.

"This ruling leaves out too many Oklahomans. Oklahomans shouldn’t have to travel across state lines just to reach an abortion clinic, and it is heartbreaking that many will not be able to do so," said Dr. Alan Braid, an abortion provider and plaintiff in the case said in a statement.

Emily Wales, president and CEO of Planned Parenthood of Great Plains called the ruling a small step toward restoring the right to abortion.

CLICK HERE TO GET THE FOX NEWS APP

"The Oklahoma Supreme Court recognized one fundamental truth: patients must be permitted to access critical care to save their lives," she said. "But the right recognized today is so limited that most people who need abortion will not be able to access it."