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 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 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 supplies no basis for disturbing Ohio’s legislative judgments about how to spend its public money,” attorneys wrote in a court brief.

Planned Parenthood has said Ohio’s law would not force any of its 28 health centers in the state to close but 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.

Planned Parenthood officials praised the judge’s decision, calling it a win for Ohio residents who rely on the organization.