MADISON, Wis. — The Wisconsin Supreme Court’s liberal majority struck down the state’s 176-year-old abortion ban on Wednesday, ruling 4-3 that it was superseded by newer state laws regulating the procedure, including statutes that criminalize abortions only after a fetus can survive outside the womb.

The ruling came as no surprise given that liberal justices control the court. One of them went so far as to promise to uphold abortion rights during her campaign two years ago, and they blasted the ban during oral arguments in November.

The statute Wisconsin legislators adopted in 1849, widely interpreted as a near-total ban on abortions, made it a felony for anyone other than the mother or a doctor in a medical emergency to destroy “an unborn child.”

The ban was in effect until 1973, when the U.S. Supreme Court’s landmark Roe v. Wade decision legalizing abortion nationwide nullified it. Legislators never officially repealed it, however, and conservatives argued that the U.S. Supreme Court’s 2022 decision to overturn Roe reactivated it.

Wisconsin Attorney General Josh Kaul, a Democrat, filed a lawsuit that year arguing that abortion restrictions enacted by Republican legislators during the nearly half-century that Roe was in effect trumped the ban. Kaul specifically cited a 1985 law that essentially permits abortions until viability. Some babies can survive with medical help after 21 weeks of gestation.

Lawmakers also enacted abortion restrictions under Roe requiring women to undergo ultrasounds, wait 24 hours before having the procedure and provide written consent, and receive abortion-inducing drugs only from doctors during an in-person visit.

“That comprehensive legislation so thoroughly covers the entire subject of abortion that it was clearly meant as a substitute for the 19th century near-total ban on abortion,” Justice Rebeca Dallet wrote for the majority.

Sheboygan County District Attorney Joel Urmanski, a Republican, defended the ban in court, arguing that it can coexist with the newer abortion restrictions.

Dane County Circuit Judge Diane Schlipper ruled in 2023 that the 1849 ban outlaws feticide — which she defined as the killing of a fetus without the mother’s consent — but not consensual abortions. Abortions have been available in the state since that ruling, but the state Supreme Court decision gives providers and patients more certainty that abortions will remain legal in Wisconsin.

Urmanski had asked the state Supreme Court to overturn Schlipper’s ruling without waiting for a decision from a lower appellate court.

The liberal justices all but telegraphed how they would rule. Justice Janet Protasiewicz stated on the campaign trail that she supports abortion rights. During oral arguments, Dallet declared that the ban was authored by white men who held all the power in the 19th century. Justice Jill Karofsky likened the ban to a “death warrant” for women and children who need medical care.

A solid majority of Wisconsin voters in the 2024 election, 62%, said abortion should be legal in all or most cases, according to AP VoteCast.