COLUMBIA, S.C. (AP) — The South Carolina Senate approved a bill Tuesday that would ban most abortions after around six weeks of pregnancy, sending the bill to the governor who has promised to sign it.

The proposal restores the ban South Carolina had in place when the U.S. Supreme Court overturned Roe v. Wade last year — a ban that, once it took effect, was overturned by the state’s highest court because it violated the state Constitution’s right to privacy.

Republicans have been searching for an answer to that ruling because it left abortion legal through 22 weeks of pregnancy and sharply increased the number of abortions taking place in South Carolina as most other Southern states enacted stricter laws.

The measure would ban abortion when an ultrasound detects cardiac activity, around six weeks, and before most people know they are pregnant. It includes exceptions for fatal fetal anomaly, the patient’s life and health, and rape or incest through 12 weeks.

BE THE FIRST TO KNOW: Sign up here for QC News Alerts and get breaking news sent straight to your inbox

The door to pass the bill opened after the South Carolina House backed off a proposal to ban abortion almost entirely at conception. Senators had not been able to get the votes for that proposal after three different tries.

Republicans said they tweaked parts of the new law so it can pass judicial review. The author of the 3-2 state Supreme Court’s leading opinion overturning the ban was also replaced after she had to retire due to age.