North Carolina abortion providers and abortion rights advocates asked a federal appeals court Thursday to invalidate a state statute that generally bars women from terminating their pregnancies after 20 weeks, a law similar to those on the books in more than a dozen states.

Two of the three judges on the panel expressed doubts about the state’s defense that the lawsuit is a case without a controversy because no abortion providers in North Carolina have ever been prosecuted under the decades-old law.

“It seems to me the only reason you would defend a lawsuit is because you want to preserve for the state the opportunity to enforce this statute,” Judge Diana Gribbon Motz told the state’s lawyer.

The U.S. Court of Appeals for the 4th Circuit is reviewing a 1973 law barring abortions after 20 weeks with exceptions for health concerns. The lawsuit was filed after the state legislature amended the statute in 2015 to narrow the medical exemptions. The law has been blocked since a district court judge struck down the measure in 2019.

Lawyers for the state told the appeals court Thursday that abortion providers have no legal grounds — or standing — to sue because all officials with authority to enforce the ban have disavowed any intention of doing so. Michael T. Wood of the North Carolina Department of Justice noted that the local district attorneys named in the case have made statements saying they will not prosecute.

In response, Motz suggested such assurances were not sufficiently binding, telling Wood, “It’s not saying tomorrow they are not going to change their minds.”

Judge Albert Diaz also asked the government’s lawyer about the intent of state lawmakers who revised the definition of a medical emergency in 2015 and included new reporting requirements for abortion providers.

“Why shouldn’t we take the legislature at its word?” Diaz asked.

The third judge on the panel, Julius N. Richardson, asked questions to both sides about how the court should determine whether there is a credible threat of prosecution that the doctors need to demonstrate to proceed with the case. He expressed doubt that the medical board would revoke a physician’s license for performing an early-stage abortion.

Attorney Genevieve Scott of the Center for Reproductive Rights told the court: “It is clear that the threat here is not imaginary or speculative.”

Richardson also pressed the government’s lawyer on whether laws regulating abortion passed recently in other states factor into the assessment of the threat.

“The fact that other states are passing related laws suggests this is a political issue that is quite lively,” Richardson said. “All of that seems to be me to suggest a threat of prosecution is more credible.”

North Carolina is one of 15 states, including Texas, Ohio and Louisiana, with similar laws. The case comes as many state legislatures have proposed or passed measures that make it more difficult for women to access abortion services or place restrictions on medical professionals and clinics where abortions are performed.

The Supreme Court has been considering for months whether to revive Mississippi’s law barring almost all abortions after 15 weeks of pregnancy. The high court has ruled since the landmark Roe v. Wade decision that states cannot block women from having abortions before a fetus is viable and could survive outside the womb.

But antiabortion activists are hoping the newly configured, more conservative Supreme Court with three justices nominated by President Donald Trump might be more open to overturning the 1973 precedent.

Challengers to the North Carolina law say it forces physicians to deny medical care to patients seeking abortion services after 20 weeks. The 2015 amendments narrowed the medical exemption to permit abortion after that period only when a woman’s life or a “major bodily function, not including any psychological or emotional conditions,” are at immediate risk.

New reporting requirements mean abortion providers must submit ultrasound images for abortions after 16 weeks for government review. After 20 weeks, providers must submit a detailed explanation to justify the medical emergency.

The changes to the law also restricted the type of doctor who may perform an abortion in the state, and lengthened the informed consent waiting period from 24 to 72 hours.

In his 2019 ruling against the state, U.S. District Judge William Osteen acknowledged that no health-care provider has been charged for violating the ban. But the legislature’s narrowing of the medical-emergency exception in 2015, the judge wrote, “revived the threat of future prosecution under the ban.”

He noted that courts across the country have struck down “week- or event-specific abortion bans.”

“The Supreme Court has clearly advised that a state legislature may never fix viability at a specific week but must instead leave this determination to doctors,” Osteen wrote.