A federal appeals court upheld abortion regulations in the state of Kentucky on Friday. The three-judge panel on the Sixth Circuit Court of Appeals ruled 2-1 that abortion providers failed to prove that a 1998 Kentucky abortion law, and its 2017 update, would result in the closure of all abortion facilities in the state.

Abortion providers, including Planned Parenthood, had challenged the 1998 state law requiring abortion facilities to have a transfer agreement with local hospitals in case of medical complications that could arise from abortions. The facilities also had to have an agreement in place for ambulance transport.

In 2017, the state imposed stricter regulations, including that a transfer agreement be with a state-licensed acute care hospital within a certain distance of the abortion facility. It also included a 90-day window for facilities to apply for a waiver to show that they could not get a transfer agreement despite having exhausted all options to do so.

Planned Parenthood and EMW Women’s Surgical Center and Planned Parenthood of Indiana and Kentucky challenged the regulations, saying they would result in the  closure of all abortion facilities in state. A federal district court sided with them, before the Sixth Circuit reversed that decision in part on Friday.

The plaintiffs, EMW, “have failed to make a clear showing that both of their abortion facilities would close” because of the laws, Judge Joan Larsen stated in her opinion, joined by Judge Chad Readler.

The law was rooted in the state’s interest in protecting public health, the judges said, noting that “we cannot say that laws requiring abortion facilities to have transfer and transport agreements with a local hospital are not reasonably related to a legitimate government end.”

Earlier this year, in the case of June Medical Services, the Supreme Court struck down a Louisiana law requiring doctors at abortion facilities to have admitting privileges at a local hospital.

However, the judges wrote on Friday, Chief Justice John Roberts’ concurrence in the ruling allowed state regulations of abortion to stand if they satisfied two requirements: that they are “‘reasonably related’ to a legitimate state interest,” and that they not put a “substantial obstacle” in the way of a woman obtaining an abortion.

The state law was in the interest of public health, and it allowed facilities to apply for a waiver if they could not satisfy the requirements of the law but had made a good-faith effort to do so, the judges said.

In the June decision, Chief Justice Roberts said that the Court’s 2016 ruling against a Texas law on admitting privileges, Whole Woman’s Health v. Hellerstedt—upon which the majority of justices relied in the June Medical case as precedent—was wrongly decided.

However, Roberts applied the legal principle of stare decisis to argue that the 2016 case was settled and the court’s ruling needed to be applied to Louisiana’s abortion law.