Pregnant teens who enter this country illegally and are held in federal custody can't be barred by the U.S. government from obtaining abortions while a lawsuit over access to such services progresses.

U.S. District Judge Tanya Chutkan ordered Friday that the government be barred from “interfering with or obstructing” pregnant minors' access to abortion counseling or abortions while a lawsuit brought by the American Civil Liberties Union (ACLU) plays out.

The Department of Health and Human Services (HHS) shelters children who illegally enter the U.S. and, according to department lawyers, it has a policy “of refusing to facilitate” abortions.

In a statement released Saturday, HHS said that it “strongly maintains that taxpayers are not responsible for facilitating the abortion of unaccompanied minors who entered the country illegally and are currently in the government's care."

ILLEGAL IMMIGRANT MINOR SUGGESTS SHE FACED PRESSURE TO GET ABORTION ON FEDERAL DIME

Scott Lloyd, the director of HHS’ Office of Refugee Resettlement, has also said that he believes teens in his agency’s care have no constitutional right to abortion.

The ACLU has filed a lawsuit on behalf of these minors.

"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," ACLU attorney Brigitte Amiri said after the judge's order became public.

ACLU FIGHTING TRUMP ADMINISTRATION OVER ILLEGAL IMMIGRANTS’ ABORTION ACCESS

Chutkan said after her order became public that while the government is “entitled to maintain an interest in fetal life" and even to prefer that pregnant minors in their custody "choose one course over the other," it cannot create or implement a policy that strips minors “of their right to make their own reproductive choices.”

HHS can appeal the order, and according to its statement, the department is "working closely with the Justice Department to review the court's order and determine next steps."

The issue first came to light when a pregnant teen, identified as Jane Doe, entered the U.S. illegally in September and, despite having a state court order permitting her to have an abortion paid for by private funding, federal officials refused to transport her or temporarily release her.

As a result of a lawsuit by the ACLU, she was ultimately able to get an abortion.

The Associated Press contributed to this report.