Republican Gov. Nikki Haley signed legislation Wednesday that immediately outlaws most abortions in South Carolina at 20 weeks beyond fertilization.

The only exceptions are if the mother's life is in jeopardy or a doctor determines the fetus can't survive outside the womb.

Doctors face up to $10,000 in fines and 3 years in prison for each violation; prison time is mandatory on a third conviction. These bans are now in effect in at least 13 states and blocked by court challenges in three others. South Dakota's ban takes effect July 1.

Women nationwide have the right to obtain abortions under the U.S. Supreme Court's 1973 Roe v. Wade ruling, which said states could restrict abortions after viability – the point when a fetus has a reasonable chance of surviving outside the uterus. "Viability is usually placed at about seven months (28 weeks) but may occur earlier, even at 24 weeks," the ruling said.

The Supreme Court has not ruled on bans that would limit even earlier abortions. Like other states, South Carolina's law ties the fetus' age to conception rather than a woman's monthly cycle. Since this date cannot be scientifically pinpointed, the ban actually refers to what doctors consider a gestational age of 22 weeks.

Supporters of the bill cite the disputed claim that a fetus can feel pain at 20 weeks. Opponents say later-term abortions usually happen with wanted pregnancies that go horribly wrong.

"The reality is that abortion later in pregnancy is extremely rare and often takes place in complex and difficult situations where a woman and her doctor need every medical option available," said Alyssa Miller, a Planned Parenthood spokeswoman for South Carolina. South Carolina's definition of "fetal anomaly" makes it illegal to abort a fetus with a severe disability if the child could live. Such anomalies are generally detected around 20 weeks.

In 2012, Haley signed a bill intended to ensure that a fetus surviving an abortion attempt is not treated as medical waste. It defined a person as anyone who is breathing and has a beating heart after birth, whether by labor, cesarean section, or abortion, copying a 2002 federal law enforceable on federal property. The ban would affect only hospitals, since none of the three abortion clinics in South Carolina provide abortions beyond 15 weeks.

On average, fewer than 30 abortions yearly are performed at 20 weeks gestation or beyond in South Carolina, according to data since 1990 from the state's public health agency. Most of these women have been white, married and older than 24, according to the agency.

Associated Press contributed to this report.