(Reuters) - A U.S. appeals court ruled on Friday that the U.S. government cannot deny access to abortions for unaccompanied immigrant minors in federal custody, delivering a blow to a Trump administration policy.

FILE PHOTO: Abortion rights activists during a rally outside the U.S. Supreme Court in Washington, U.S., May 21, 2019. REUTERS/Kevin Lamarque/File Photo - RC186F726170

A three-judge panel of the U.S. Court of Appeals for the District of Columbia Circuit upheld a lower court decision that found the government cannot unduly burden the ability of a woman to obtain an abortion under established Supreme Court precedent.

The case involves the intersection of two divisive social issues on which Republican President Donald Trump has taken a hard line: abortion and immigration.

It began with a 17-year-old girl, whose name and nationality were not disclosed and was called “Jane Doe” in legal papers. She came to the United States alone in 2017 and was placed in the care of the Office of Refugee Resettlement, which falls under the U.S. Department of Health and Human Services and houses immigrant children.

The girl, who was in the United States illegally, obtained an abortion after suing the administration in federal court. But the Supreme Court last year allowed the litigation to continue in lower courts to determine the fate of other detained immigrants in similar situations.

The Office of Refugee Resettlement in March 2017 announced that shelters were “prohibited from taking any action that facilitates an abortion without direction and approval from the Director.” Scott Lloyd, who had become the agency’s director that month, then denied every abortion request presented to him during his tenure even when the pregnancy resulted from rape, according to the appeals court ruling. Lloyd left his post at the end of 2018.

“The policy functions as an across-the-board ban on access to abortion,” the appeals court ruling said.

The U.S. Justice Department declined to comment.

In the 2018 fiscal year, there were almost 50,000 unaccompanied minors referred to the refugee office’s network of some 100 shelters around the United States.

Minors from countries other than Mexico or Canada who cross the border alone stay in federal care until they can be released to sponsors in the United States or until they turn 18 and are transferred to immigration detention. In fiscal year 2017, the only year for which data is available, 18 pregnant unaccompanied minors in the refugee office’s custody requested abortions, according to the court ruling.

The Trump administration could appeal the ruling to the Supreme Court but Justice Brett Kavanaugh, a conservative Trump appointee who participated in the case when he served on the D.C. Circuit, would likely be recused. That would leave the court split 4-4 along ideological grounds.