Following two days of testimony from abortion experts, providers, and the state’s chief medical officer, a Michigan judge barred county prosecutors from enforcing the state’s 1931 abortion ban for the foreseeable future on Friday.

The decision comes after the state Court of Appeals ruled earlier this month that county prosecutors were not covered by a May order and could enforce the prohibition following the Supreme Court’s decision to overturn Roe v. Wade.

“The harm to the body of women and people capable of pregnancy could not be more real, clear, present, and dangerous to the court,” Oakland County Judge Jacob Cunningham said in his ruling Friday.

An appeal is planned, according to David Kallman, an attorney representing two Republican county prosecutors.

Cunningham sought a restraining order against county prosecutors shortly after the appeals court decision on Aug. 1 and in response to a request from attorneys representing Democratic Gov. Gretchen Whitmer.

While the majority of prosecutors in counties with abortion clinics have stated that they will not enforce the ban, Republican prosecutors in Kent, Jackson, and Macomb counties have stated that the 1931 law should be enforced.

Cunningham heard arguments in Pontiac on Wednesday and Thursday before issuing the preliminary injunction, which is expected to keep abortion legal throughout the state until the Michigan Supreme Court or voters make a decision in the fall. The Michigan law, enacted in 1931 in response to the United States Supreme Court’s decision to overturn Roe v. Wade, prohibits abortion in all circumstances except those involving the mother’s life. Judge Elizabeth Gleicher issued a preliminary injunction in May, preventing the dormant ban from going into effect retroactively.

The state Court of Appeals later ruled that the preliminary injunction only applied to the attorney general’s office, implying that some county prosecutors could charge providers with a felony.

Attorneys for Whitmer and Democratic prosecutors argued that allowing county prosecutors to decide whether to enforce the 1931 ban would create confusion and force many abortion providers to discontinue all abortion services.

“We can’t expect doctors to read prosecutors’ minds and figure out what a prosecutor thinks that life-saving exception means.” That is exactly what would happen if the preliminary injunction was not issued,” Washtenaw County Prosecutor Eli Savit stated during closing arguments on Thursday.

In closing arguments, Kallman stated that granting a preliminary injunction is not how laws should be changed.

“It is the right of all Michigan residents to weigh in and vote, or to go through their representatives and do it through the proper legislative and elected process to change a law,” Kallman said. In July, a ballot initiative seeking to enshrine abortion rights in the state constitution received 753,759 signatures and is expected to determine the status of abortion access in Michigan. The amendment is awaiting final approval by the state’s Board of Canvassers for inclusion on the November ballot.

The status of abortion in Michigan is expected to have a significant impact on the November general election in the battleground state, where Whitmer and Attorney General Dana Nessel, both Democrats, have made abortion rights a centerpiece of their reelection campaigns.

“Without this preliminary injunction, physicians face a very real threat of prosecution depending on where they practice,” Nessel said in a statement issued after the ruling on Friday.