Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — A federal appeals court Friday refused to allow an immediate abortion for a 17-year-old who came to the U.S. illegally and is now in detention. But the court gave her more time to find a way to obtain one.

Groups supporting and opposing abortion rights have been watching the case closely.

Known in the court record only as Jane Doe, she crossed the southern border on her own in September, unaccompanied by relatives, and was taken into federal custody at a detention center in Texas. After a medical examination revealed that she is pregnant, she sought an abortion.

Texas authorities gave her permission, but the Department of Health and Human Services, which runs the detention facility, refused.

On Wednesday, a federal judge in Washington ordered the government to let her leave the facility to get an abortion. But the appeals court put that order on hold and held an emergency hearing Friday.

By a 2-1 ruling, the panel of judges said she must be allowed to try to find a sponsor, which would permit her to be released from detention. Such an arrangement, the Trump administration argued, would not unduly burden the constitutional right of access to abortion services.

"We agree," the appeals court said, "so long as the process of securing a sponsor to whom the minor is released occurs expeditiously."

The ruling set a deadline of Tuesday, October 31. If a sponsor isn't found by then, the ruling said, the lower court judge can again order the government to let her obtain an abortion, and the government can then appeal.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"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," said Brigitte Amiri, senior staff attorney with the ACLU Reproductive Freedom Project, which represented Jane Doe.

“Our client and women across this country should be able to access a safe, legal abortion without federal officials stepping in to interfere. We are investigating all avenues to get justice for her," Amiri added.

The court was hoping that the sponsor solution would avoid the task of deciding whether women like Jane Doe have a constitutional right to seek an abortion.

"This is kicking the can down the road," said Professor Steve Vladeck of the University of Texas law school. "And because of the strict abortion laws in Texas, there's not a lot of road left."

At its core, the legal issue is whether the government is simply refusing to help her get an abortion, or whether it is actually preventing from doing so.

The Obama administration permitted young women in Jane Doe's position to get abortions. But in March, HHS announced that all federally funded shelters are prohibited from taking "any action that facilitates" access to abortion by unaccompanied minors.

Justice Department lawyer Catherine Dorsey told the appeals court Friday that the federal government "has not put any obstacles in her path. Rather the government is refusing to facilitate an abortion, which it is permitted to do in furtherance of its legitimate interest in protecting fetal life and childbirth."

Jane Doe can obtain an abortion by returning to her home country in Central America or finding a U.S. citizen willing to sponsor her presence in the U.S., Dorsey said.

Allowing unaccompanied minors to get an abortion while in custody, she said, would be facilitating it, because detention facility staff would have to go with them.

But the ACLU said the government is holding her hostage, literally blocking the door to prevent her getting the care she wants. A high number of young immigrant women need access to reproductive services, the ACLU said, because many of them are the victims of sexual assault before and during their journeys to the United States.

"No one may have a veto power over anyone's abortion decision, including a parent or a husband," the ACLU's Amiri told the court.

And it's by no means certain, the ACLU said, that she would have access to abortion services if she left the US and went home, where she was abused by her parents.

Groups opposed to abortion had urged the court not to overturn the Trump administration policy.

Kristin Hawkins of Students for Life of America said the such a decision would "force taxpayer and government involvement in abortions for everyone, including illegal immigrants. The US should not become the home of International Abortion, Inc."

If the issue is not resolved by the lower courts, the U.S. Supreme Court would likely be asked to take up the case.