WASHINGTON ― The U.S. Court of Appeals for the D.C. Circuit sided with an undocumented pregnant teenager in a nationally watched case on Tuesday, ordering that she could obtain an abortion. The decision, by the full court of appeals, overrules a divided ruling issued last week by a panel of three federal appeals court judges sitting on the court.

By majority rule, the federal appeals court judges said that a lower appeals court should reissue an order that allowed the undocumented teen to obtain an abortion. The majority ruling said the district court was “best suited to promptly determine in the first instance the appropriate dates for compliance with the injunction” and that the court would retain “full discretion to conduct proceedings and make any factual findings deemed necessary and appropriate to the district court’s exercise of its equitable judgment.”

Michael S. Williamson/The Washington Post via Getty Images The Planned Parenthood Federation of America and coalition partners protest last week for Jane Doe's right to get an abortion.

The case involves “Jane Doe,” a 17-year-old undocumented immigrant from a country where abortion is outlawed. Doe, who is now about 16 weeks pregnant, received permission from a state judge to receive an abortion back on Sept. 25, and her abortion has now been delayed for a month as she has moved into her second trimester. Delaying the abortion longer would increase health risks to the 17-year-old and threaten her ability to get an abortion at all. In Texas, where she is in government custody, abortion is illegal after 20 weeks.

In a dissent, U.S. Circuit Judge Brett Kavanaugh, a George W. Bush appointee who was on Trump’s shortlist for the Supreme Court, said the majority ruling amounted to allowing “unlawful immigrant minors to have an immediate abortion on demand.” He wrote that the case was “novel and highly fraught” and that he thought the panel of three judges made the right decision.

“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. But consider the circumstances here. The minor is alone and without family or friends. She is in a U.S. Government detention facility in a country that, for her, is foreign. She is 17 years old. She is pregnant and has to make a major life decision,” he wrote. “Is it really absurd for the United States to think that the minor should be transferred to her immigration sponsor ― ordinarily a family member, relative, or friend ― before she makes that decision?”

The teen has been in U.S. government custody for nearly two months and two people have been ruled out as potential sponsors. Attorneys said they are unsure whether anyone else is available in the near future.

The Trump administration has refused to allow her to leave government custody to get an abortion, instead sending her to a “crisis pregnancy center” where she was urged not to terminate the pregnancy. A government attorney said officials are not blocking her access to abortion ― she could leave the country to get one, even though it would take her out of immigration proceedings and the procedure is illegal in her native country. The attorney also said she could find a U.S. sponsor, which is out of her hands and controlled by the government.

She did everything that Texas law requires to obtain an abortion. That has been undisputed in this case. Judge Patricia Millett

Judge Patricia Millett, who dissented from the prior ruling by the panel, said the decision by the full court “rights a grave constitutional wrong” by the government.

“Remember, we are talking about a child here. A child who is alone in a foreign land. A child who, after her arrival here in a search for safety and after the government took her into custody, learned that she is pregnant. [Jane Doe] then made a considered decision, presumably in light of her dire circumstances, to terminate that pregnancy. Her capacity to make the decision about what is in her best interests by herself was approved by a Texas court consistent with state law. She did everything that Texas law requires to obtain an abortion. That has been undisputed in this case,” Millett wrote.

Millett said the Trump administration had “bulldozed over constitutional lines” by contending that Jane Doe should be forced to leave the country if she wanted an abortion.

“Surely the mere act of entry into the United States without documentation does not mean that an immigrant’s body is no longer her or his own. Nor can the sanction for unlawful entry be forcing a child to have a baby,” Millett wrote. “The bedrock protections of the Fifth Amendment’s Due Process Clause cannot be that shallow.”

The American Civil Liberties Union, which is representing Jane Doe, argued the government was violating her constitutional right to an abortion.

Last Wednesday, U.S. District Judge Tanya Chutkan sided with them and ordered the government to allow Jane Doe to obtain an abortion “promptly and without delay.”

The next day, however, the appeals court again delayed her abortion so it could hear the case. The panel then ruled that the government could continue to block the teen from getting an abortion until at least Oct. 31, so long as it searched for a sponsor in the U.S. to take her in.

Blocking Jane Doe’s abortion is part of a larger pattern from the Trump administration.

The Office of Refugee Resettlement, which takes custody of unaccompanied minors apprehended at the border and finds sponsors to take them in, has created new anti-abortion policies under President Donald Trump. Since at least March, the office has disallowed shelters from taking minors to terminate their pregnancies without the approval of its anti-abortion director, E. Scott Lloyd.

Under the previous administration, ORR directors were only involved in decision-making with regard to the use of federal funds for abortions for victims of rape and incest, or if the life of the mother was at risk.

The Office of Refugee Resettlement has taken other measures to deter abortion as well. The agency sent Jane Doe to a “crisis pregnancy center” where she was urged to reconsider her decision, and barred her from recreational activities, according to her attorneys. Other minors have received direct pressure from ORR officials ― including Lloyd himself ― not to get abortions.

Read the court order below: