Story highlights The court sets an October 31 deadline for the government to find her a sponsor

ACLU files emergency petition for a rehearing en banc, which means by the full court

(CNN) A federal appeals court Friday ruled that an undocumented teenage immigrant held in detention in Texas may obtain an abortion, but it delayed the process, giving the Trump administration 11 days to find a sponsor to take custody of the girl beforehand.

The ruling set a deadline of October 31 for the US Department of Health and Human Services (HHS) to get a sponsor for the girl, who is a minor.

The 17-year-old, identified in court documents only as "Jane Doe," came to the United States without her parents and is staying in a shelter for unaccompanied immigrant minors run by the Office of Refugee Resettlement, according to court documents.

"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," according to the order from the US Court of Appeals for the DC Circuit.

Texas Attorney General Ken Paxton issued a statement Friday saying he was "disappointed" with the court's decision because it gives the federal government time to find a sponsor for the teen "so she can be taken for an abortion."

Read More