Washington (CNN) A federal appeals court in Washington, DC, Friday said the Trump administration cannot block pregnant unaccompanied migrant minors in federal custody from access to abortions.

"The policy functions as an across the board ban on access to abortion," a panel for the US Court of Appeals for the District of Columbia Circuit wrote

"Under binding Supreme Court precedent, a person has a constitutional right to terminate her pregnancy before viability and the government cannot unduly burden her decision," the ruling added.

A lower court had issued a preliminary injunction. Friday's federal appeals court action upholds it, holding that challengers are likely to succeed on the merits of their claim.

In March 2017, the Office of Refugee Resettlement announced that shelters are "prohibited from taking any action that facilitates an abortion without direction and approval from the Director" Scott Lloyd. Lloyd denied every abortion request presented to him during his tenure.

A minor who is released to a sponsor is no longer subject to the ban and it does not apply to unaccompanied minors who turn 18 and are then transferred to Department of Homeland Security custody. DHS allows a pregnant woman in its custody to obtain an abortion.

Four plaintiffs initially brought the case, including the lead plaintiff known in court papers as "Jane Doe," who was apprehended at the border when she was 17 and placed in a shelter in Texas. She had obtained private funding and arranged for her own transportation but she was blocked per Lloyd's instruction. She was eventually able to obtain the abortion once court stepped in.

The Trump administration had asked the appeals court to reverse the lower court, arguing that the court committed an error by certifying an "overbroad class that sweeps in all pregnant minors, including the large majority who do not want abortion services and many who will not agree with the controversial pro-choice claims being asserted on their purported behalf."

"The Constitution does not require the ORR to facilitate abortions," the Justice Department argued.

But in an unsigned opinion, the appeals court held on Friday that access to abortion is barred "even if her pregnancy results from rape."

"It does not matter if an unaccompanied minor meets all the requirements to obtain an abortion under the law of the state where she is held -- including for instance, demonstrating she is mature enough to decide on her own whether to terminate her pregnancy."

Judges Sri Srinivasan and Robert Wilkins were in the majority.

Judge Laurence Silberman dissented from Friday's opinion noting that he agreed with Brett Kavanaugh, who while serving on the same appeals court before his elevation to the Supreme Court, dissented from his colleagues during an earlier part of a related challenge.

Kavanaugh explained back then that an issue before the court was whether the government could "expeditiously transfer Jane Doe to an immigration sponsor before she makes the decision to have an abortion."

"The majority seems to think that the United States has no good reason to want to transfer an unlawful immigrant minor to an immigration sponsor before the minor has an abortion," Kavanaugh said in 2017.

He said the government "is merely seeking to place the minor in a better place when deciding whether to have an abortion."

Silberman wrote that the majority's refusal to consider narrowing the scope of a district court's order "justifies Judge Kavanaugh's accusation that the court is endorsing abortion on demand -- at least as far as the federal Government is concerned."