(CNN) A federal appeals court on Tuesday cleared the way for an undocumented teen in detention in Texas to end her pregnancy against the objections of the Trump administration.

The full D.C. Circuit Court of Appeals ruled that 17-year-old Jane Doe is entitled to seek an abortion without delay.

The 6-3 ruling reverses a decision by a three-judge panel on the same court that stalled the process by ordering the US Department of Health and Human Services to find a sponsor for the girl.

In light of Tuesday's ruling, a district court judge ordered HHS to allow the teen to be transported "promptly and without delay" to the abortion provider of her choosing.

Jane Doe is almost 16 weeks pregnant. She came to the United States without her parents from a unspecified country and learned she was pregnant while she was in an HHS shelter, according to a lawsuit filed on her behalf by the ACLU . After she received judicial authorization to consent to an abortion, the federal government intervened and refused to transport her, triggering the lawsuit.

In a strongly worded opinion on Tuesday, appeals court Circuit Judge Patricia Ann Millett challenged the government's actions.

"The government's mere hope that an unaccompanied, abused child would make the problem go away for it by either (i) surrendering all of her legal rights and leaving the United States or (ii) finding a sponsor the government itself could never find is not a remotely constitutionally sufficient reason for depriving J.D. of any control over this most intimate and life altering decision," the judge wrote.

Advocates welcome ruling

The case hits on two divisive social issues the Trump administration has challenged: abortion and immigration. Timing has made the matter urgent because Texas law bans abortion after 20 weeks.

"Every additional week the government delays her abortion increases the risks associated with the procedure," the American Civil Liberties Union said in an emergency petition Sunday.

The ACLU said the teen is not seeking assistance from the government to obtain the abortion, as her court-appointed representatives will transport her to the health facility and private funds will pay for the procedure.

Planned Parenthood President Cecile Richards welcomed Tuesday's ruling.

"For weeks now, (HHS official) Scott Lloyd and the Trump administration have used every tool at their disposal to prevent her from accessing the health care she deserves -- substituting their judgment for hers. We hope that this ruling sends a strong signal to the Trump administration. Access to safe, legal abortion is the law," Richards said in a statement.

"Every woman deserves access to basic health care, including abortion, regardless of her immigration status. It is outrageous that the Trump administration and its various appointees, continue to put women's health and lives at risk, in pursuit of their extremist political and ideological agenda. We demand that the Trump administration stop playing politics with women's lives."

Case background

The teen's fate has bounced around the court system for weeks.

Since arriving in the United States, she has been in a custody shelter for unaccompanied immigrant minors run by the HHS Office of Refugee Resettlement.

Because Texas law requires parental consent or a judicial waiver for a minor to obtain an abortion, she went to court with a guardian to seek judicial permission. A judge granted her the legal authority to consent to the procedure. However, the shelter refused to transport her, citing a policy policy of "refusing to facilitate" abortions.

The move prompted the ACLU to file a lawsuit on her behalf on October 13.

"This administration has no shame and no regard for a woman's health or decisions," said Brigitte Amiri, senior staff attorney with the ACLU Reproductive Freedom Project.

"Weeks ago, our client decided to end her pregnancy. Her decision has been disregarded and she's now been dragged into a protracted legal battle over her ability to get the care she needs."

On October 18, a federal judge ordered HHS to allow her to be transported by a guardian or attorney to an abortion provider to obtain state-mandated counseling before the abortion. The next day, a three-judge panel from the D.C. Circuit Court of Appeals issued an administrative stay of that ruling -- with one judge dissenting -- to "give the court sufficient opportunity to consider the emergency motion" filed by the government.

After hearing oral arguments, the panel of judges ruled on October 20 the teenager could have the abortion but delayed the process. The ruling set a deadline of October 31 HHS to get a sponsor for the girl.

However, approving a sponsor could take weeks or even months, said Robert Carey, who was director of the Office of Refugee Resettlement from March 2015 to January of this year.

"The entire process involves many steps, including: 'the identification of sponsors; the submission by a sponsor of the application for release and supporting documentation; the evaluation of the suitability of the sponsor, including verification of the sponsor's identity and relationship to the child, background checks, and in some cases home studies; and planning for post-release,'" Carey said in a declaration filed with the D.C. District Court.

Texas Attorney General Ken Paxton said last week he was "disappointed" with the decision to give the federal government time to find a sponsor for the teen. He has not commented on Tuesday's ruling.

"Unlawfully present aliens with no substantial ties to the US do not have a right to abortion on demand," Paxton said. "Texas must not become a sanctuary state for abortions."

What dissenting judge says

Appeals court Judge Brett Kavanaugh -- who some believe may be on the short list to replace Supreme Court Justice Anthony Kennedy if he were to ever retire -- filed a dissent, joined by two other judges.

He wrote that the full court based its decision "on a constitutional principle as novel as it is wrong: a new right for unlawful immigrant minors in US government detention to obtain immediate abortion on demand."

Kavanaugh said that "all parties" recognize Roe v. Wade and Planned Parenthood v. Casey as precedents that "we must follow." He stressed an issue before the panel was whether the government could "expeditiously transfer Jane Doe to an immigration sponsor before she makes the decision to have an abortion."

Kavanaugh said that once Jane Doe was assigned the sponsor "the government accepts" that she could decide whether to have the 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," he said.

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

"After all, the Supreme Court has repeatedly said that the government has permissible interests in favoring fetal life, protecting the best interests of the minor, and not facilitating abortion, so long as the government does not impose an undue burden on the abortion decision."