WASHINGTON (AP) — A federal appeals court on Tuesday cleared the way for a 17-year-old immigrant held in custody in Texas to obtain an abortion.

The full U.S. Court of Appeals for the District of Columbia Circuit ruled 6-3 that new dates should be set for the teen to obtain the procedure. The decision overruled a ruling by a three-judge panel of the court that at least temporarily blocked her from getting an abortion. Tuesday’s decision could still be appealed to the Supreme Court.

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

She obtained a state 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.

Lawyers for the Department of Health and Human Services, which is responsible for sheltering children who illegally enter the country unaccompanied by a parent, have said the department has a policy of “refusing to facilitate” abortions and that releasing the teenager would require arranging a transfer of custody and follow-up care.

The teenager’s lawyers have said all the government needed to do was “get out of the way.” An attorney appointed to represent the teen’s interests has said she could transport her to and from appointments necessary for the procedure, and the federal government would not have to pay for it.

A federal judge sided with the teen and set dates for the procedure last week, but the government appealed. The three-judge panel of the appeals court ruled 2-1 on Friday that the government should have until Oct. 31 to release the teen, so she could obtain the abortion outside government custody.