Lawmakers in the midwestern U.S. state of South Dakota have passed legislation that would ban all abortions except when a woman's life is in danger.

After final legislative approval, the state's governor must sign the bill in order for it to become law. The governor, Republican Mike Rounds, has said he opposes abortion.

If approved, the South Dakota bill would directly challenge the U.S. Supreme Court decision legalizing abortion. Doctors in the state who perform abortion would face a maximum five-year prison term.

Spokeswomen for Planned Parenthood, an activist organization that supports abortion rights, said if the governor signs the bill, the group will file a lawsuit to block it.

Earlier this week, the U.S. Supreme Court agreed to hear a separate case on a federal law banning certain late-term abortions.

Abortion has been one of the most contentious issues in U.S. politics since the 1973 Roe v. Wade Supreme Court decision legalized the practice across the nation. The Court upheld abortion as a right in the 1992 case of Planned Parenthood v. Casey.

Some information for this report was provided by AP and Reuters.