WASHINGTON — A federal court in Washington told the Trump administration Friday that the government can't interfere with the ability of pregnant immigrant teens being held in federal custody to obtain abortions.

A judge issued an order Friday evening barring the government from "interfering with or obstructing" pregnant minors' access to abortion counseling or abortions, among other things, while a lawsuit proceeds. The order covers pregnant minors being held in federal custody after entering the country illegally.

Lawyers for the Department of Health and Human Services, which is responsible for sheltering children who illegally enter the country unaccompanied by a parent, have said the department has a policy of "refusing to facilitate" abortions. And the director of the office that oversees the shelters has said he believes teens in his agency's care have no constitutional right to abortion.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The American Civil Liberties Union brought a lawsuit on behalf of the minors, which the judge overseeing the case also Friday allowed to go forward as a class action lawsuit.

"We have been able to secure justice for these young pregnant women in government custody who will no longer be subject to the government's policy of coercion and obstruction while the case continues," said ACLU attorney Brigitte Amiri after the judge's order became public.

The government can appeal the judge's order. A Department of Justice spokesman didn't immediately respond to an emailed request for comment Friday evening.

Today’s ruling puts us one step closer to ending this extreme policy of blocking countless young women from their right to abortion care, once and for all. #JusticeForJane — ACLU (@ACLU) March 31, 2018

The ACLU and Trump administration have been sparring for months over the government's policy. In a high profile case last year, the ACLU represented a teen who entered the U.S. illegally in September and learned while in federal custody in Texas that she was pregnant. She obtained a state court order permitting her to have an abortion, but federal officials refused to transport her or temporarily release her so that others could take her to get the procedure. The teen was ultimately able to get an abortion in October as a result of the lawsuit, but the Trump administration has accused the ACLU of misleading the government during the case, a charge the ACLU has denied.

Activists with Planned Parenthood demonstrate in support of a pregnant 17-year-old being held in a Texas facility for unaccompanied immigrant children to obtain an abortion, outside of the Department of Health and Human Services on Oct. 20, 2017 in Washington. J. Scott Applewhite / AP file

The ACLU has since represented several other teens who have sought abortions while in custody, but the organization doesn't know of any others actively seeking abortions, Amiri said Friday night. The judge's order now covers any teens currently in custody or who come in to custody while the lawsuit goes forward.

In a deposition taken in December as part of the litigation, Scott Lloyd, the director of the U.S. Department of Health and Human Services' Office of Refugee Resettlement, which oversees shelters for unaccompanied immigrant minors, said that pregnant teens in his agency's care have no right to abortion under the Constitution. Lloyd, who has written about his own opposition to abortion, said he had not approved any abortions since becoming director in March 2017. That included refusing the abortion request of a teen who had been impregnated as a result of rape.

U.S. District Judge Tanya Chutkan said in ruling Friday that Lloyd and his office are "certainly entitled to maintain and interest in fetal life, and even to prefer that pregnant" minors in their custody "choose one course over the other," but the government can't create or implement a policy that strips minors "of their right to make their own reproductive choices."