A federal judge on Friday blocked an Ohio law that would have defunded Planned Parenthood — by kicking it out of state grant programs for public health and education services, like maternal health and HIV prevention programs.

“Today’s ruling supports the rights of all Ohioans to access needed health care,” said Iris E. Harvey, president and CEO of Planned Parenthood of Greater Ohio, in a statement. “This law would have been especially burdensome to communities of color and people with low income who already often have the least access to care.”

Although Ohio Attorney General Mike DeWine says he will appeal the ruling, many health advocates are breathing a sigh of relief. As I reported last year, some officials warned that the bill could have had severe public health consequences for Ohio. Not only was Planned Parenthood a major provider of these health services that couldn’t easily be replaced but the bill was also written so poorly that it could have accidentally defunded Ohio’s public health departments in the process of trying to go after Planned Parenthood.

That’s because the law didn’t just target Planned Parenthood. It also blocked funding for any abortion provider — and for any entity that contracted or affiliated with an organization that provides or “promotes” abortion. This language was so broad that Kelli Arthur Hykes, director of public health policy at Columbus Public Health, told Vox that it could have stripped funds for her local health department.

The law would have blocked Planned Parenthood, and other entities connected to abortion services in almost any way, from receiving funding for:

The "Healthy Moms, Healthy Babies" program that supports mostly black mothers before, during, and after pregnancy. The program is aimed at reducing abysmally high infant mortality rates in Ohio, which are the highest in the nation for black Americans

Several federal programs that help low-income people access breast exams, Pap smears, and screenings and treatment for STIs and HIV

Funds from the Violence Against Women Act to provide education for high school–age youth, including youth who are in jail or foster care, on domestic violence, intimate partner violence, and healthy relationships

“The defunding law in Ohio would have stopped Planned Parenthood from providing HIV tests, cancer screenings, and assistance for poor mothers with newborn infants,” said Kellie Copeland, president of NARAL Pro-Choice Ohio, in a statement.

This law, and others like it, tries to punish Planned Parenthood for providing abortions

It’s already true that no federal or Ohio state funds can pay for abortion services at Planned Parenthood. Public funding is only used for other family planning and health services, like contraception or STD tests.

Ohio Gov. John Kasich has also “defunded” Planned Parenthood before; he signed a budget in 2013 that stripped $1.4 million in family planning funds from the organization.

But Kasich, like several other conservative governors, has been determined to get rid of every possible source of public funding for Planned Parenthood. This rush intensified after an anti-abortion group released deceptive videos alleging that Planned Parenthood “sells baby parts.”

Even though DeWine, the attorney general, found no evidence that Planned Parenthood did what the videos claimed — and even though every state and federal investigation into the matter has made similar findings — it hasn’t dampened the enthusiasm of Kasich and other abortion opponents for trying to further defund the organization.

DeWine did claim — falsely, as it turned out — that Planned Parenthood improperly disposed of fetal remains. Advocates accused DeWine of trying to create a distraction from the fact that he couldn’t prove Planned Parenthood illegally sold fetal tissue. The state of Ohio was forced to pay Planned Parenthood’s legal fees as a result.