COLUMBUS, Ohio — A federal judge blocked a state law aimed at diverting public money from Planned Parenthood, saying in a Friday ruling that the group stood to suffer “irreparable injury.”

The Ohio law targets the more than $1.4 million in funding that Planned Parenthood gets through the state's health department. That money, mostly from the federal government, supports certain education and prevention programs. The law would bar such funds from going to entities that perform or promote abortions.

The restrictions, which had been slated to take effect in May, were signed by Republican Gov. John Kasich during his failed presidential bid.

The state's Republican attorney general will appeal the ruling, his spokesman said.

Planned Parenthood of Greater Ohio and Planned Parenthood of the Southwest Ohio Region had sued the state, saying the law violated their constitutional rights by denying them the funds “in retaliation for” providing abortions. Their lawsuit names the state's health director as a defendant.

U.S. District Judge Michael Barrett in Cincinnati sided with Planned Parenthood in granting a permanent injunction, which keeps state officials from enforcing the law's provisions.

Barrett, who was nominated to the bench by then-President George W. Bush, a Republican, said that in many instances Planned Parenthood was chosen over other entities to receive the funds as part of a competitive grant process.

He said if the changes were to take effect the group couldn't offer some free services and would no longer have access to the juvenile justice and foster care systems to teach teenagers about healthy relationships.

If not blocked, the judge wrote, Planned Parenthood would “suffer a continuing irreparable injury for which there is no adequate remedy at law.”

The state's attorneys had argued that Planned Parenthood was trying to override state policy choices and that no entity has a constitutional right to receive public money.

Planned Parenthood has said that Ohio's law would not force any of its 28 health centers in the state to close but that the legislation would deprive thousands of patients of access to HIV tests, breast and cervical cancer screenings and other prevention and education initiatives.

The group's attorneys argued the law was unconstitutional because it required, as a condition of receiving government funds, that recipients abandon their constitutionally protected rights to free speech and to provide abortion services.

Under the U.S. Supreme Court's 1973 Roe v. Wade ruling, women have a constitutionally protected right to terminate a pregnancy before a fetus is able to survive outside the womb, generally around 24 weeks of pregnancy.

Federal law and the laws of most states already prevent public money from paying for abortions except in rare circumstances, but recent defunding bills have aimed to prohibit state money for any services by an organization that also provides abortions.