(CNN) — An Arizona Superior Court judge ruled Friday that a 1901 ban on nearly all abortions in that state can be enforced, a decision that is likely to see an appeal and is all but certain to galvanize female voters to turn out in greater numbers in the state’s closely contested US Senate and governor’s races.

In ruling that Arizona’s near-total ban on abortion could take effect, Pima County Superior Court Judge Kellie Johnson granted a request by the state’s Republican attorney general to lift a court injunction that had barred enforcement of Arizona’s pre-statehood ban on abortion after the Supreme Court ruled in Roe v. Wade in 1973.

“The court finds that because the legal basis for the judgment entered in 1973 has now been overruled, it must vacate the judgment in its entirety,” Johnson wrote in the ruling released Friday.

The case has thrust the issue of how restrictive abortion law should be in Arizona, a swing state that President Joe Biden carried by fewer than 11,000 votes. It’s a controversial topic that has divided Republicans in Arizona and is reflective of a pitched debate nationwide in the wake of the US Supreme Court overturning Roe v. Wade in late June, with many GOP-led states passing increasingly restrictive measures that run the risk of alienating moderate voters.

The judge’s ruling effectively outlaws all abortions in Arizona except when the procedure is necessary to save the mother’s life. The decision came a day before a 15-week ban on abortion was slated to go into effect in Arizona. That law was passed by Arizona lawmakers before the US Supreme Court decision.

Conservative Arizona lawmakers included language in the bill banning abortion after 15 weeks stating that the new legislation would not override the 1901 law — which was passed before Arizona became a state and can be traced back to as early as 1864. In addition to barring abortion in all cases except when “it is necessary to save (the mother’s) life,” the pre-statehood law carries a prison sentence of two to five years for abortion providers.

While fighting the attorney general’s move to allow the 1901 abortion ban to be enforced, abortion rights groups had argued that if both laws were to go into effect, it would create significant confusion for both abortion providers and women seeking care. But the judge said in her ruling that she was not weighing in on how the conflict between Arizona’s abortion laws would be settled.

“While there may be legal questions the parties seek to resolve regarding Arizona statutes on abortion, those questions are not for this Court to decide here,” Johnson wrote in the decision.

The ruling drew a swift rebuke from several Democratic groups that favor abortion rights and Democratic gubernatorial nominee Katie Hobbs, who said she was “outraged and devastated” by the decision.

“There’s no doubt in my mind that this draconian 1901 law will have dire consequences on the health and well-being of Arizona women and their families,” Hobbs said in a statement. “This cruel law effectively outlaws abortion in Arizona — with no exceptions for rape or incest — and risks women’s fundamental freedom to make their own health care decisions. … To make matters worse, this law mandates jail time for abortion providers. Medical professionals will now be forced to think twice and call their lawyer before providing patients with oftentimes necessary, lifesaving care.”

White House press secretary Karine Jean-Pierre criticized the Arizona court ruling as “catastrophic, dangerous and unacceptable.”

“Make no mistake: this backwards decision exemplifies the disturbing trend across the country of Republican officials at the local and national level dead-set on stripping women of their rights, including through (South Carolina Sen. Lindsey) Graham’s proposed national abortion ban,” she said in a statement.

Arizona GOP Attorney General Mark Brnovich, who led the legal process to try to get the state’s pre-statehood ban on abortion put back into effect after the Supreme Court struck down Roe v. Wade in late June, tweeted that he was pleased by the decision:

“We applaud the court for upholding the will of the legislature and providing clarity and uniformity on this important issue. I have and will continue to protect the most vulnerable Arizonans,” he tweeted.

The disagreement over Arizona’s abortion laws has created a confusing legal landscape in Arizona for much of the summer that has unfolded against the backdrop of a shifting national political mood ahead of November’s midterm elections. While both historical trends and the nation’s sour mood about inflation had initially appeared to favor Republicans in their quest to take control of the US House and Senate this November, the Supreme Court’s decision on abortion has energized female voters all over the country — a dynamic that led to the surprising victory for proponents of abortion rights in Kansas and better-than-expected performances for Democrats in special elections for the US House since the Dobbs ruling.

The ruling injects a new uncertainty into the marquee statewide races. Republicans, who need a net gain of just one seat to flip the Senate, are trying to unseat Democratic Sen. Mark Kelly as he runs for a full six-year term. And Democrats are trying to flip the governor’s mansion, currently held by term-limited Republican Gov. Doug Ducey.

In the Arizona governor’s race, Hobbs has portrayed GOP opponent Kari Lake as “extreme” on abortion. Lake has repeatedly said she is opposed to the procedure and in an August news conference said that she would “uphold the laws that are on the books.” But she did not specify which laws she meant. “If people don’t like the laws on the books, then they need to elect representatives who will change the laws. I’m running for governor, not for God. So I don’t get to write the laws,” she said.

Her campaign has not responded to CNN’s requests for clarification on her view of the pre-statehood law.

Both Lake and GOP Senate nominee Blake Masters, who is challenging Kelly, have argued that their Democratic opponents have adopted positions that are too far out of the mainstream in favor of abortion rights.

Masters removed language from his campaign website expressing support for a “federal personhood law” and other conservative anti-abortion stances after winning the GOP nomination last month. His campaign told CNN that Masters does support Graham’s proposal for a federal ban on abortion at 15 weeks, which would provide exceptions to protect the life of the mother and in cases of rape or incest.

But before the ruling, Masters’ campaign did not respond to questions about his position on the pre-statehood law or the court case to enforce it.

In a statement Friday, Kelly said the decision would “have a devastating impact on the freedom Arizona women have had for decades: to choose an abortion if they need one. Let’s be clear, this is exactly what Blake Masters wants, to completely ban abortions in Arizona and across the country — without even an exception for rape or incest. I will never stop fighting to restore these rights for Arizona women.”

Planned Parenthood Federation of America fought Brnovich’s move in Pima County Superior Court — the court that handled the 1973 injunction.

The group’s lawyers had argued that the court had a duty to “harmonize all of the Arizona Legislature’s enactments as they exist today.” In the post-Dobbs era, the group argued that the pre-statehood law could “be enforceable in some respects” but that it should not apply to abortions provided by licensed physicians — and instead that the ban should apply to anyone other than a licensed physician who attempts to provide abortion services.

In a statement, Brittany Fonteno, president and CEO of Planned Parenthood Arizona, said Friday’s ruling “has the practical and deplorable result of sending Arizonans back nearly 150 years. No archaic law should dictate our reproductive freedom and how we live our lives today.”

(Copyright (c) 2024 CNN. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Join our Newsletter for the latest news right to your inbox