A divided federal appeals court upheld an Ohio law Tuesday that strips Planned Parenthood of government funding for a wide variety of health services for women solely because it also provides access to abortion.

Among those services are cervical and breast cancer screening, prevention of sexually transmitted diseases, HIV/AIDS treatment and education of teens on how to avoid pregnancy.

Overturning two lower court decisions and bolstered by four new appointees of President Trump, the U.S. Court of Appeals for the 6th Circuit, by a vote of 11 to 6, rejected arguments that the 2016 Ohio law imposed unconstitutional conditions on the state’s distribution of federal funds.

The opinion written by Judge Jeffrey Sutton overturned a district-court ruling and a decision by a three-judge appeals court panel holding that the law violated Planned Parenthood’s First Amendment right of advocacy as well as constitutional protections for abortion rights.

The lower courts’ opinions cited Supreme Court precedent against placing unconstitutional conditions on the receipt of federal funds, but the appeals court majority said the law did not impose such conditions because private organizations, such as Planned Parenthood, had no guaranteed right to funds for anything, including to perform or advocate abortion.

“Governments generally may do what they wish with public funds, a principle that allows them to subsidize some organizations but not others,” the majority said.

While women have a right to abortion, third parties such as Planned Parenthood have no guaranteed right to perform them, wrote Sutton, an appointee of President George W. Bush.

Trump appointees Amul Thapar, John K. Bush, Joan Larsen and John B. Nalbandian joined the majority. Judge Helene White, appointed by George W. Bush, wrote in dissent, arguing that the law did indeed amount to an “unconstitutional condition,” which she said includes “indirect” burdens on the right to abortion. Plus, she noted, the other health services defunded in Ohio have nothing to do with abortion.

The 6th Circuit’s jurisdiction covers Kentucky, Michigan, Ohio and Tennessee. The U.S. Court of Appeals for the 7th Circuit issued a similar ruling in 2012 upholding an Indiana law. The U.S. Court of Appeals for the 10th Circuit went the other way in a challenge to a Utah law in 2016, over the objection of Neil M. Gorsuch, then sitting on that appeals court and now a Supreme Court justice, who wanted to rehear the case on procedural grounds.

The conflicts will make it hard for Supreme Court to avoid the issue as it’s tried to do recently, to the consternation of Gorsuch and Justices Samuel A. Alito Jr. and Clarence Thomas.

Federal law has long denied funding to organizations for the purpose of performing or promoting abortions. But groups such as Planned Parenthood have separated abortion-related activity from other medical services for women, which have continued to receive federal funds.

Ohio’s 2016 law, signed by then-Gov. John Kasich, was enacted in the wake of secretly filmed videos purporting to show Texas Planned Parenthood employees discussing the illegal sale of fetal tissue, which the organization denied doing.

Planned Parenthood and others claimed the undercover videos were manipulated, a charge disputed by Texas officials and the Center for Medical Progress, the anti-abortion organization that created them.

While Planned Parenthood has been a political, legislative and legal target of the right for decades, the unsubstantiated charges spurred additional punitive legislation across the country.

In a friend-of-the-court brief, the Trump administration urged the judges to rule as they did Tuesday. Coincidentally, the Justice Department official who signed that brief, then-acting assistant attorney general Chad Readler, just joined the 6th Circuit after being confirmed by the Senate last Wednesday.

The case was closely watched, with friend-of-the-court briefs filed not only by the Trump administration, but also by 14 states saying they had similar laws or prospective laws that would be jeopardized. The American Public Health Association filed in opposition to Ohio’s law.

In a statement, Planned Parenthood of Ohio called the decision a “shameful” and “direct attack on health care access for Ohio’s most at-risk communities.”

Ohio Gov. Mike DeWine (R) said in a statement he was “pleased” by the ruling “as he has long believed that the people of Ohio, through its state legislature, have the right to decide what it funds and what it doesn’t fund.”

Correction: An earlier version of this story said the videos of Texas Planned Parenthood employees were found to have been manipulated. It should have pointed out that others, including Texas officials and the video producers, dispute that charge.