Updated

A federal judge ruled Wednesday that the federal government must grant a pregnant 17-year-old illegal immigrant access to publicly funded abortion services in Texas.

U.S. District Court Judge Tanya Chutkan ordered the authorities to transport the minor or allow her to be transported by someone else to the abortion clinic “promptly and without delay."

The lawsuit was brought by the American Civil Liberties Union (ACLU), centering around the minor called “Doe,” and whether illegal minors have a right to publicly funded health services, including abortions, in the U.S.

Last week, Texas State Attorney General Ken Paxton came out in opposition to the legal challenge, saying Texas should not become “a sanctuary state for abortions.”

“No federal court has ever declared that unlawfully present aliens with no substantial ties to this country have a constitutional right to abortion on demand,” he said in an official statement, citing the woman’s case.

The ACLU, meanwhile, argued in court that the Trump administration was forcing the pregnant woman to continue with the pregnancy against her wishes. She is believed to be around 15 weeks pregnant and in Texas a pregnancy can be terminated only before 20 weeks, the Texas Tribune reported.

"The Trump administration's action is shocking. A young woman is essentially being held hostage and forced by federal officials to continue a pregnancy against her will," ACLU attorney Brigitte Amiri told the Austin Chronicle just before the ruling.

U.S. Deputy Assistant Attorney General Scott Stewart countered the group, saying the minor is free to return to the country of origin and get an abortion there, adding that “the government is entitled to favor childbirth” and under no responsibility to encourage abortions.

The federal judge said she was “astounded” by the government’s suggestion of either leaving the country or having pregnancy against the minor’s will.

Government lawyers also argued that illegal minors from other countries have no right to abortion in the U.S. unless it’s a medical emergency.

Following the ruling against the government, the U.S. Department of Health and Human Services has issued a statement, calling the judge’s decision “troubling” and pledged to take the “next steps to ensure our country does not become an open sanctuary for taxpayer-supported abortions by minors crossing the border illegally.”

The Associated Press contributed to this report.