At a shelter in South Texas, a teenager is fighting the federal government to get an abortion.

The 17-year-old, identified in court documents as Jane Doe, came to the US as an undocumented, unaccompanied minor. She was taken into custody at the United States-Mexico border on September 11.

Since President Donald Trump took office, policies toward undocumented young people seeking abortions have changed. According to the American Civil Liberties Union, which filed suit on behalf of Doe, all unaccompanied minors in immigration shelters now need permission from the director of the Office of Refugee Resettlement — and he has gone to extraordinary lengths to prevent undocumented young people from getting the procedure. In Doe’s case, ORR has prevented her from leaving the Texas shelter where she now lives in order to get an abortion.

Last Wednesday, United States District Judge Tanya Chutkan ordered the government to allow Doe to leave for the procedure. The government appealed, and last Friday, a new court order bought the government some time: ORR had until October 31 to transfer Doe from the shelter into the care of a qualified sponsor who would let her get an abortion. If such a sponsor couldn’t be found, the ACLU could return to court to seek another order requiring ORR to release Doe for the procedure. The ACLU appealed the ruling and on Tuesday, an appeals court ruled in Doe’s favor. That means she should be able to schedule and obtain an abortion — unless the government appeals again.

The clock is ticking — Doe is 15 weeks pregnant, and Texas law bans abortions after 20 weeks. And Doe’s case matters not just for her, but for the thousands of unaccompanied minors who cross the border every year.

Undocumented, unaccompanied minors face new abortion restrictions under the Trump administration

This spring, President Trump appointed E. Scott Lloyd to head the Office of Refugee Resettlement, which is responsible for caring for unaccompanied, undocumented minors while they wait for decisions in their immigration cases. Around the same time, according to the ACLU, the ORR instituted a new policy: Shelters were to take no action to help minors get abortions without Lloyd’s permission. That included scheduling appointments or transportation, or arranging for minors to get counseling that included information about abortion. Previously, minors only needed to seek permission from ORR if they wanted the federal government to pay for their abortions, since federal funding for the procedure is restricted by the Hyde Amendment, said Brigitte Amiri, the lead lawyer for the ACLU on Doe’s case.

Because of the new policy, the ACLU says Jane Doe’s shelter prevented her from getting to a health center for counseling, and made clear she would not be allowed to get the abortion. Texas law requires parental consent for a minor to get an abortion, but Doe was able to get permission from a judge to seek the procedure since her parents are not in the country. She was not seeking help paying for the abortion or setting up transportation for the procedure, BuzzFeed News reported.

“The US Supreme Court has said in Roe v. Wade that the government can’t ban abortion, and that’s exactly what happened here,” Amiri told Vox. “The government was blocking Jane Doe from accessing abortion by essentially holding her hostage. Any first-year law student would tell you that is unconstitutional.”

Doe is not the only minor who’s been affected by the policy, according to the ACLU. In March, according to court documents filed by the group, another minor at a shelter in Texas chose to have a medication abortion after getting a judge’s permission for the procedure. After she had taken the first dose of the medication, ORR officials forced her to go to an emergency room to see if the abortion could be reversed. Ultimately, she was allowed to proceed with the abortion and take the remaining dose of the medication. In another case, the ACLU said, Lloyd traveled from Washington, DC, to meet personally with a young woman to try to convince her not to have an abortion.

According to the ACLU, ORR requires minors seeking abortions to get counseling at crisis pregnancy centers, which are anti-abortion and sometimes give patients misinformation. Jane Doe was required to go to a crisis pregnancy center, where she was forced to have a medically unnecessary ultrasound.

In a statement to Vox, the Administration for Children and Families, of which the ORR is part, called Judge Chutkan’s order “a troubling ruling that exceeds the U.S. Constitution and sets a dangerous precedent by opening our borders to any illegal children seeking taxpayer-supported, elective abortions.”

“Though the order overrides the policies and procedures of the Office of Refugee Resettlement designed to protect children and their babies who have illegally crossed the border, we will continue to provide them with excellent health care and protect their well-being in all our facilities,” the ACF said. “We will consider our next steps to ensure our country does not become an open sanctuary for taxpayer-supported abortions by minors crossing the border illegally.”

In a motion to stay Judge Chutkan’s order pending an appeal, the government argued that allowing Jane Doe to terminate her pregnancy would violate Department of Health and Human Services policy against facilitating abortions, because it would require HHS or shelter staff to “draft and sign approval documents” and “monitor Ms. Doe’s health during and immediately after the abortion,” among other tasks. If Doe wants to get an abortion, the motion says, she can leave the United States or find a qualified sponsor to live with who will let her get one. The court order issued on Friday required Doe to pursue the second option — finding a sponsor — before she could again ask the government to release her for the abortion.

Jane Doe’s case matters for other undocumented minors, too

Undocumented immigrants in general face obstacles to reproductive health care, from fear of encountering immigration officials on the way to a clinic to a lack of health insurance. But unaccompanied minors living in shelters face unique challenges. Shelters are typically operated by private organizations that contract with the government, and even before the ORR policy change, some of these organizations blocked minors from getting birth control, emergency contraception, or abortions, according to a fact sheet issued by the National Women’s Law Center earlier this year.

This is especially problematic for “young people who have experienced real trauma, and maybe have experienced sexual assault, and are then put in a space where they can’t get access to reproductive health care,” said Kelli Garcia, the director of reproductive justice initiatives at the NWLC, in a September interview with Vox. “It’s shameful.”

The ACLU has also filed a motion for class certification, which would help all undocumented minors in Jane Doe’s situation seek abortions without intervention by ORR. For now, the fate of that motion is uncertain. So is Doe’s future — the ruling on Tuesday sends her case back to district court, which will issue a new order requiring ORR to release Doe for the abortion. However, the government still has the opportunity to appeal.

In the meantime, Doe, who has been trying to get an abortion since September, will have to wait at least a little longer.

“She is tired of the fight,” Amiri said, “but she is resilient, and she is very, very brave.”