Image copyright ACLU Image caption ACLU protests in support of Jane Doe

The Trump administration cannot prevent a teenage undocumented immigrant from obtaining an abortion in Texas, an appeals court has ruled.

The 17-year-old, identified only as Jane Doe, is 15 weeks pregnant.

She requested an abortion at the government-funded shelter where she was placed after being apprehended near the Mexico border.

However, a new policy implemented by the Trump administration has denied her access to a clinic.

According to the American Civil Liberties Union (ACLU), Jane Doe came from an abusive home in an unnamed country in Central America.

Not long after crossing the border on 7 September, she was stopped by US border officials.

The ACLU says because she is an unaccompanied minor Jane Doe was transported to a government-funded shelter in Brownsville, Texas, under the jurisdiction of the Office of Refugee Resettlement (ORR).

While in ORR custody, Jane Doe was given a physical and told she was nine weeks pregnant.

She asked the shelter staff to help her arrange an abortion.

Under Texas law, minors must obtain parental consent in order to have the procedure.

In late September, Jane Doe obtained a judicial waiver and had an appointment at a local abortion clinic for 28 September.

But the day before her appointment, she was denied transportation to the clinic after ORR officials intervened.

"The federal government is holding Jane Doe hostage and preventing her from having an abortion," said Brigitte Amiri, senior staff lawyer for the ACLU. "It is blatantly unconstitutional."

According to a new policy implemented by the Trump administration, no federally funded shelters can assist a minor in their custody to obtain an abortion without written authorisation from E Scott Lloyd, the director of the Office of Refugee Resettlement.

In March, Mr Lloyd wrote in an email to colleagues that shelters receiving federal dollars "should not be supporting abortion services pre- or post-release; only pregnancy services and life-affirming options counseling".

Mr Lloyd has long been a staunch pro-life advocate. The lawsuit alleges that he has personally contacted pregnant minors in ORR custody to persuade them not to go through with abortion procedures.

According to court filings, Jane Doe was taken to a so-called "crisis pregnancy centre" where she was given an ultrasound and advised on alternatives to abortion.

Her mother was also notified about the pregnancy, against Jane Doe's wishes.

Meanwhile, her pregnancy is at 15 weeks - abortions are illegal in the state of Texas after 20 weeks.

Lawyers for the US government argued that they were not preventing Jane Doe's access to an abortion.

They said she could leave the country or be placed in the care of a sponsor.

According to her lawyers, no viable sponsor has been approved for the teenager after a seven-week search.

On 18 October, US District Court Judge Tanya Chutkan agreed with the ACLU, and ordered that the teenager be transported "promptly and without delay" to a clinic.

"I'm astounded that the government is going to make this 17-year-old girl who has received judicial authorisation for a medical procedure to which she is constitutionally authorised choose between a pregnancy that she does not want to go forward with to term or returning to the country from which she left," said Judge Chutkan.

However, after the federal government appealed, a DC Circuit Court of Appeals panel of judges ruled 2-1 that the government is not preventing Jane Doe's access to an abortion, because she should find a sponsor to take her out of government custody.

Her lawyers argued that the sponsorship process could take months.

The ACLU filed an emergency appeal to a full panel of 10 judges, which ruled that the original district court's ruling should stand, and Jane Doe should be transported from the shelter to have the abortion.

Jane Doe was able to have the abortion on 25 October after a nearly one month delay, and immediately afterward released a statement through her court appointed guardian.

"People I don't even know are trying to make me change my mind. I made my decision and that is between me and God. Through all of this, I have never changed my mind," she wrote.

"No one should be shamed for making the right decision for themselves."

Lawyers for the ACLU said they would proceed with a class-action lawsuit on behalf of all undocumented minors in federal custody who may seek abortion services.