WASHINGTON (AP) — An appeals court is blocking, for now, an abortion sought by a pregnant 17-year-old immigrant being held in a Texas facility, ruling that the government should have time to try to release her so she can obtain the abortion outside of federal custody.

A three-judge panel of the U.S. Court of Appeals for the District of Columbia issued its ruling Friday hours after arguments from lawyers for the Trump administration and the teenager.

The court ruled 2-1 that the government should have until Oct. 31 to release the girl into the custody of a sponsor, such as an adult relative in the United States. If that happens, she could obtain an abortion if she chooses. If she isn't released, the case can go back to court.

The judge who dissented wrote that the court's ruling means the teen will be forced to continue an unwanted pregnancy for "multiple more weeks."

The teen, whose name and country of origin have been withheld because she's a minor, is 15 weeks pregnant. She entered the U.S. in September and learned she was pregnant while in custody in Texas.

She obtained a court order Sept. 25 permitting her to have an abortion. But federal officials have refused to transport her or temporarily release her so that others may take her to have an abortion.

A lower federal court ruled that she should be able to obtain an abortion Friday or Saturday, but the government appealed.

Federal health officials said in a statement that for "however much time" they are given they "will protect the well-being of this minor and all children and their babies" in their facilities.

Susan Hays, legal director of the Texas group Jane's Due Process, which works with pregnant minors seeking an abortion and had offered to help pay for the teen's abortion, said the court appeared to be "punting" the final decision on whether the teenager would be entitled to an abortion.

Photo: Activists with Planned Parenthood demonstrate in support of a pregnant 17-year-old being held in a Texas facility for unaccompanied immigrant children to obtain an abortion, outside of the Department of Health and Human Services in Washington, Friday, Oct. 20, 2017. (AP Photo/J. Scott Applewhite)

Brigitte Amiri, the ACLU lawyer who represented the teen in court, said in a statement that the group is "investigating all avenues to get justice for her."

"Justice is delayed yet again for this courageous and persistent young woman. She continues to be held hostage and prevented from getting an abortion because the Trump administration disagrees with her personal decision," Amiri said.

"Our client and women across this country should be able to access a safe, legal abortion without federal officials stepping in to interfere."

The teenager's lawyers have argued that even a brief delay in allowing her to obtain an abortion could mean she may need a more complex procedure, one possibly not available in the region where she lives.

If that happens, she could have to travel hundreds of miles to obtain an abortion, and if her case drags on she could lose her right to an abortion all together, her lawyers said. Texas law bans most abortions after the 20th week of pregnancy.

During arguments at the appeals court, Amiri told the judges that all the government needed to do was "get out of the way."

An attorney appointed to represent the teen's interests had said she could transport her to and from appointments necessary for the procedure, and the federal government would not have to pay for it.