MADISON, Wis. (AP) — Wisconsin’s 173-year-old abortion ban outlaws killing fetuses but doesn’t apply to consensual medical abortions, a judge ruled Friday in allowing a lawsuit challenging the ban to continue in the perennial battleground state.

Dane County Circuit Judge Diane Schlipper said the legal language in the ban doesn’t use the term “abortion” so the law only prohibits attacking a woman in an attempt to kill her unborn child.

“There is no such thing as an `1849 Abortion Ban` in Wisconsin,” the judge wrote.

Wisconsin lawmakers enacted statutes in 1849 that have until now been widely interpreted as outlawing abortion in all cases except to save the mother’s life. The U.S. Supreme Court’s landmark 1973 Roe v. Wade ruling legalizing abortion nullified the ban, but legislators never repealed it. Then, the high court’s decision last June to overturn Roe v. Wade reactivated the statutes.

Republicans and their conservative allies across the country praised the reversal, but the decision energized Democratic voters. Wisconsin Gov. Tony Evers parlayed anger over the ruling into a re-election victory in November. The issue figures to be front and center again in the state as the 2024 presidential campaign ramps up.

The state’s Democratic attorney general, Josh Kaul, has vowed to restore abortion access. He filed a lawsuit in Dane County days after Roe v. Wade was overturned, seeking to repeal the ban.

Kaul argues that the ban is too old to enforce and that a 1985 law that permits abortions before a fetus can survive outside the womb supersedes the ban. Three doctors later joined the lawsuit as plaintiffs, saying they fear being prosecuted for performing abortions.

Kaul has named district attorneys in the three counties where abortion clinics operated until the Supreme Court overturned Roe v. Wade as defendants. One of them, Sheboygan County’s Republican district attorney, Joel Urmanski, filed a motion seeking to dismiss the case in December.

Urmanski maintained that it’s a stretch to argue that the ban is so old it can no longer be enforced and that the 1985 law and the ban complement each other. Since the newer law outlaws abortions post-viability, it simply gives prosecutors another charging option, he contends.

Kaul’s attorneys have countered that the two laws are in conflict and doctors need to know where they stand.

Schlipper explained in a written ruling denying Urmanski’s dismissal motion that she interprets the 1849 law as prohibiting people from killing fetuses by assaulting or battering the mother. The law doesn’t apply to consensual medical abortions because it doesn’t use the word “abortion.” Therefore, a doctor who performs an abortion is criminally liable only if the fetus was viable under the 1985 law, she wrote.

That means the doctor plaintiffs could ultimately win a declaration that they can’t be prosecuted for performing abortions and hence the case should continue, Schlipper wrote.

Andrew Phillips and Jacob Curtis, two of Urmanski’s attorneys, didn’t immediately respond to emails seeking comment on the decision. Heather Weininger, executive director of Wisconsin Right to Life, a group that advocates against abortion, called the ruling “a devastating setback in our ongoing fight to protect Wisconsin’s preborn children.”

The ruling means that the lawsuit will continue in Schlipper’s courtroom. Regardless of how the judge ultimately rules, the case carries so much weight for the future of the state that it almost certainly will rise to the state Supreme Court, which is exactly where Democrats want it.

Liberal justices will control the court with a 4-3 majority after progressive Janet Protasiewicz is sworn in on Aug. 1. She stopped short on the campaign trail of saying how she would rule on a challenge to the 1849 ban but said repeatedly she supports abortion rights.

Evers tweeted Friday that Schlipper’s decision to allow the case to continue is “good news and a critical step” toward restoring reproductive rights.