A Michigan judge barred local prosecutors from enforcing a 1931 abortion ban on Monday, just hours after an appeals court ruled that they could, according to state Attorney General Dana Nessel.

However, in Kentucky, a recent judge’s ruling reinstates two abortion bans for the time being, while the underlying challenge to the laws is litigated.

Nessel stated that the temporary restraining order issued by Oakland County Judge Jacob Cunningham in Michigan halted action under an earlier Monday ruling by an appeals court that had opened the door to such prosecutions.

“In the short term, this temporary restraining order ensures that prosecutors cannot target women or providers,” Nessel said in a press release. “Women should feel confident in proceeding with their planned medical procedures, and providers in those counties should feel confident in practicing medicine without fear of prosecution.”

The Michigan law, one of several state abortion bans enacted before the Roe v. Wade decision legalized abortion nationwide nearly 50 years ago, makes abortion a felony unless the pregnant woman’s life is in danger.

The back-and-forth over whether it can be enforced is the latest example of conflicting legal rulings that are whipsawing abortion providers and patients in a number of states with conservative-majority legislatures, as abortion regulation falls to the states and new and old laws are challenged in court.

Kentucky’s state Court of Appeals granted Republican Attorney General Daniel Cameron’s emergency request to reinstate two laws that would outlaw almost all abortions. Previously, a lower court had blocked the two laws, ruling that they likely violated the state constitution.

In Michigan, the Court of Claims blocked enforcement of the 1931 ban by state officials in May. However, on Monday, a three-judge panel of the state Court of Appeals ruled in favor of the prosecutors, citing their status as local officials. This appeared to be a victory for anti-abortion activists.

“A county prosecutor is fundamentally a local, not a state official. Because county prosecutors are local officials, the Court of Claims does not have jurisdiction over them “Stephen Borrello, the presiding judge, wrote.

David Kallman, the lawyer for the local prosecutors who sought the order, did not immediately respond to a request for comment from Reuters. He previously stated that Kent and Jackson County prosecutors Christopher Becker and Jerry Jarzynka were “very pleased” with the appeals court ruling that they were not state officials.

Democratic Governor Gretchen Whitmer, who filed a lawsuit in April to prevent the 1931 law from going into effect, has made abortion access in Michigan a central part of her re-election campaign this fall.

Whitmer is urging the state Supreme Court to recognize the right to abortion under the state constitution, fearing that the Republican-controlled legislature will try to restrict abortion.

Abortion rights supporters have also petitioned to have a state constitutional amendment put on the ballot this fall, allowing Michigan voters to decide whether abortion rights are protected. Polls show that the vast majority of Michigan residents support the right to abortion.

Abortion rights activists submitted signatures earlier this month in order to bring a constitutional amendment to Michigan voters in November that would affirm the right to make pregnancy-related decisions without interference, including abortion and reproductive services like birth control.

If the amendment is approved, it will take the place of the 1931 law.