Ohio’s efforts to cut off Planned Parenthood from receiving funds for preventive health programs violate the organization’s First Amendment rights, a federal appeals court has ruled.

On Wednesday, a three-judge panel of the U.S. Court of Appeals for the 6th Circuit struck down a 2016 law that banned Ohio abortion providers or abortion rights promoters from receiving funds through six federal health programs intended to help low-income patients receive prevention services for sexually transmitted diseases, breast and cervical cancer, infertility and HIV/AIDS, among other things.

States have been allowed to refuse to subsidize abortions for years, but these services are completely unrelated to abortions. Therefore, the court found, Ohio unfairly punished Planned Parenthood compared to other grant recipients because the health provider advocates for abortion rights “on its own time and dime.”

The panel ruled unanimously that this is a violation of Planned Parenthood’s freedom of speech. and creates an “unconstitutional condition.”

Judge Helene N. White, a George W. Bush appointee, wrote that the government “may not require the surrender of constitutional rights as a condition of participating in an unrelated government program.”

“Ohio’s important interests in preferring childbirth to abortion, promoting life, and not subsidizing abortions have only the most tenuous relationship to” the 2016 law, White wrote.

“Precluding Plaintiffs from funding under the six federal preventive-health programs that have nothing to do with abortion does little to promote these interests.”

The law was passed in 2016 after three “sting” videos created by antiabortion activists went viral the previous summer. The videos purported to show Texas Planned Parenthood employees discussing the illegal sale of fetal tissue, which the organization staunchly denied.

The videos, which were later found by various government agencies and judges to be manipulated, enraged conservatives and antiabortion advocates, spurring legislation across the country seeking to defund Planned Parenthood in retaliation.

Gov. John Kasich (R) signed the bill into law in February 2016, despite the fact that multiple federal and state investigations, including in Ohio, found no evidence of the sale of fetal tissue at Planned Parenthood. In fact, the two antiabortion activists were indicted by a Houston grand jury for infiltrating Planned Parenthood with fake IDs and soliciting the sale of fetal tissue, charges that were later dropped on technicalities.

Had the law not been blocked, it would have cut more than $1.3 million in funding from Planned Parenthood, preventing it from providing various free health services to low-income patients.

The Ohio Planned Parenthood plaintiffs together administered more than half of all sexually transmitted disease tests in Ohio under the federally funded STD Prevention Program. Roughly 75 percent of Planned Parenthood of Southwest Ohio’s patients and 40 percent of Planned Parenthood of Greater Ohio’s patients are low-income.

Many of them live in “medically underserved areas,” where alternative health care providers would be difficult to find in the event that the patients were unable to receive services at Planned Parenthood because of the funding cut, the 6th Circuit said.

“This victory is critically important for tens of thousands of Ohioans across our state that rely on Planned Parenthood for care and education each year,” Jerry Lawson, CEO of Planned Parenthood of Southwest Ohio, said in a statement. “Our patients deserve to have their health care come before political agendas. This isn’t about politics; it’s about access to health care.”

What happens to Roe v. Wade without Ruth Bader Ginsburg?

Justice Ruth Bader Ginsburg died on Friday at age 87

The Supreme Court will review the ruling on a restrictive Louisiana abortion law

Clinic owners said the effect of the law would be to close most of the state’s abortion clinics, leaving only one doctor eligible to perform the procedure