A federal appeals court ruled late Friday that the Trump administration can block an undocumented teen in federal custody from having an abortion while it finds the girl a sponsor.

The U.S. Court of Appeals for the District of Columbia ordered the Department of Health and Human Services (HHS) in a 2-1 decision to find and release the 17-year-old girl — known in court documents only as Jane Doe — to a sponsor by 5 p.m. on Oct. 31.

The court said it agreed with the government’s argument that it does not violate Jane Doe’s right to an abortion under the Supreme Court’s precedent to transfer her to a sponsor, which would allow her to obtain an abortion, so long as it’s done expeditiously.

“If a sponsor is secured and J.D. is released from HHS custody to the sponsor, HHS agrees that J.D. then will be lawfully able, if she chooses, to obtain an abortion on her own pursuant to the relevant state law,” the court said in the two-page order.

ADVERTISEMENT

“If a sponsor is not secured and J.D. is not released to the sponsor by that time, the District Court may re-enter a temporary restraining order, preliminary injunction, or other appropriate order, and the Government or J.D. may, if they choose, immediately appeal.”

The order came just hours after the court heard oral arguments in the government’s appeal of a lower court decision ordering the government to "promptly and without delay" allow the undocumented teen to visit an abortion provider near the Texas detention facility where she is being held.

The administration argued that HHS policy does not require it to “facilitate” an abortion.

The judges during arguments appeared to struggle with having to issue a ruling with such sweeping implications on immigrant rights so quickly.

Judge Brett Kavanaugh asked if the issue would be resolved if Jane Doe was released into the custody of a sponsor.

In its order Friday evening, the court noted that the government "had assumed for the purposes of this case" that Jane Doe possessed a constitutional right to an abortion in the U.S.

During arguments, Department of Justice Attorney Catherine Dorsey had said it was fair for the government to assume she did but that still did not require HHS to facilitate the abortion.

Brigitte Amiri, a senior staff attorney for the American Civil Liberties Union, which brought the case on Jane Doe's behalf, pushed the court to act quickly.

She noted that Jane Doe is already 15 weeks pregnant and the state of Texas bans abortions after 20 weeks.

“If we get so far she’ll be forced to carry the pregnancy to term against her will,” Amiri said.

Judge Patricia Millett, who was appointed to the court by former President Barack Obama Barack Hussein ObamaDemocratic Senate campaign arm outraises GOP by M in August A federal court may have declared immigration arrests unconstitutional Blunt says vote on Trump court nominee different than 2016 because White House, Senate in 'political agreement' MORE, dissented from the court’s decision. In a scathing statement released separately she said, “there are no winners in cases like these. But there sure are losers.”

“As of today, J.D. has already been forced by the government to continue an unwanted pregnancy for almost four weeks, and now, as a result of this order, must continue to carry that pregnancy for multiple more weeks,” she said. “Forcing her to continue an unwanted pregnancy just in the hopes of finding a sponsor that has not been found in the past six weeks sacrifices J.D.’s constitutional liberty, autonomy, and personal dignity for no justifiable governmental reason.”

Millett noted that the government has refused to release Jane Doe to the guardian the court appointed to help determine what’s in her best interest and that HHS would not be fronting the cost of the procedure.

“It is undisputed that J.D.’s guardian and attorneys—not the federal government—will transport her and bear the costs of the abortion procedure,” she said.

“The logistics and paperwork of transferring her to the custody of her guardian ad litem will all be handled by a government contractor that is fully willing to do so ... The Department of Health and Human Services’ only task is to refrain from barring its contractor from allowing J.D. to receive the medical care.”

The government argued that Jane Doe could voluntarily leave the country, but Millett said she would be surrendering all legal claims to remain in the United States and returning to a country where she suffered terrible abuse in her family.

"That is wrong and that is unconstitutional," Millett said.

Kavanaugh and Karen LeCraft Henderson were the two judges who issued the order, Kavanaugh was nominated to the court by Republican President George W. Bush, and Henderson by George H. W. Bush.

This story was last updated at 7:13 p.m.