South Dakota moved closer to imposing some of the strictest limits on abortion in the nation as the state Senate approved legislation that would ban the procedure except when the woman's life is in danger.

The bill, designed to spark a courtroom showdown over the legality of abortion, passed 23-12 Wednesday. On Thursday, it was headed back to the House, where lawmakers already approved similar legislation.

Republican Gov. Mike Rounds, a longtime abortion opponent, has said he would "look favorably" on an abortion ban if it would "save life."

Under the measure, doctors in South Dakota would face up to five years in prison for performing an abortion. The only exception would be for women who need abortions to save their lives.

"In my opinion, it is the time for the South Dakota Legislature to deal with this issue and protect the lives and rights of unborn children," said Sen. Julie Bartling, a Democrat and the bill's main sponsor.

The legislation targets Roe v. Wade, the landmark 1973 Supreme Court decision legalizing abortion.

Opponents say it is too extreme and unconstitutional. Planned Parenthood, which operates the only clinic that provides abortions in South Dakota, pledged to challenge the measure if it become law.

"South Dakota's ban is the most sweeping abortion ban passed by any state in more than a decade," Planned Parenthood Federation of America lawyer Eve Gartner said in a written statement. She said the organization would do everything it could to ensure that women and their doctors, not politicians, made their health care decisions.

Supporters say an anonymous donor has pledged to provide South Dakota with $1 million to help defend the law in court.

The recent appointment of Justices John Roberts and Samuel Alito make the U.S. Supreme Court more likely to consider overturning Roe v. Wade now, Bartling and other supporters said.

"It is a calculated risk to be sure, but I believe it is a fight worth fighting," said Sen. Brock Greenfield, a Republican who also is director of South Dakota Right to Life.

Some senators, including Republicans, were concerned that the legislation did not include exceptions for abortions in cases of rape or incest.

Republican Sen. Stan Adelstein said it would be "a continued savagery unworthy of South Dakota" to make a woman bear a child if she becomes pregnant as the result of rape.

The Legislature passed a similar bill two years ago, but Rounds issued a technical veto because it would have wiped existing restrictions off the books while the bill was involved in a court challenge.

Including Thursday, the Legislature has five days left before the official end of its session.