An ongoing legal battle over a request from an immigrant teen, referred to as Jane Doe in court filings, for an abortion while in federal custody has sparked protests. (Michael S. Williamson/The Washington Post)

The 17-year-old crossed illegally into the United States after making the trek north from Central America. She dreamed of studying nursing and, someday, caring for senior citizens. Having a baby, her lawyers say, was not part of her plans.

But she was detained at the U.S.-Mexico border and, after a medical examination, told that she was pregnant. She tried to schedule an abortion, but the Trump administration blocked her, prompting a lawsuit in federal court.

Early Wednesday, after an appeals court ruling in her favor, the teenager identified as Jane Doe in court papers left a federally funded Texas shelter, where she had been kept under close watch, and terminated her pregnancy.

“I’m not ready to be a parent,” she said in a statement provided by her lawyers. “I made my decision, and that is between me and God. Through all of this, I have never changed my mind.”

The abortion ended the girl’s individual court challenge in a case that drew widespread attention and evoked the incendiary issues of abortion rights and illegal immigration. But the broader legal battle over whether the federal government may continue to dissuade, and even block, undocumented teens in its custody from having abortions is still pending in U.S. District Court in Washington.

Here's what abortion was like in the United States before and after the landmark Supreme Court case, and where it may be headed next. (Gillian Brockell/The Washington Post)

The Trump administration had no comment on the case Wednesday, even as a leading Republican in Texas criticized the Justice Department’s failure to appeal the teen’s case to the Supreme Court in time to halt her abortion.

Texas Attorney General Ken Paxton said that he and 11 other Republican state attorneys general were prepared to file a legal brief with the high court to help defend the Trump administration’s position.

“This ruling not only cost a life, it could pave the way for anyone outside the United States to unlawfully enter and obtain an abortion,” Paxton said in a statement.

New York Attorney General Eric T. Schneiderman, one of 14 Democratic attorneys general who filed a court brief in support of the girl, said the group stands “ready to support every other Jane Doe fighting for the fundamental right to make her own health care decisions.”

The Trump administration said in court that it has a new policy of refusing to “facilitate” abortions for unaccompanied minors taken into federal custody after crossing the border illegally.

The American Civil Liberties Union, which represented the teen, said that policy violates the minors’ constitutional right to an abortion in the United States.

Hundreds of pregnant undocumented immigrants have been in federal custody in recent years, according to court filings.

“Justice prevailed today for Jane Doe. But make no mistake about it, the administration’s efforts to interfere in women’s decisions won’t stop with Jane,” said Brigitte Amiri, the ACLU attorney who argued the case in court.

The abortion on Wednesday followed a roller-coaster legal battle that moved swiftly through the courts, with judges issuing contradictory rulings.

On Tuesday, the full U.S. Court of Appeals for the D.C. Circuit took the unusual step of reversing a three-judge panel of the same court without first holding oral argument.

The panel’s decision, issued Friday, would have postponed the abortion.

Instead, the D.C. Circuit’s 6-to-3 ruling sent the case back to U.S. District Judge Tanya S. Chutkan, who hours later reissued an earlier order requiring the government to let the teen have the abortion “promptly and without delay.”

Her guardians rushed to arrange transportation to the nearest abortion provider. The Justice Department mulled whether to ask the Supreme Court to put the D.C. Circuit order on hold.

Government lawyers, who did not immediately ask for a hold after the Tuesday ruling, may have miscalculated how quickly the teen could receive an abortion.

Texas law requires counseling from a doctor at least 24 hours in advance of an abortion, but the 17-year-old underwent that counseling Oct. 19, allowing her to go forward with the procedure once Chutkan issued her order.

By the time the Supreme Court opened for business Wednesday, it appears there was no issue left for the justices to decide.

The teen was more than 15 weeks pregnant when her pregnancy was terminated. Texas bars abortions, except in the case of a medical emergency, after 20 weeks. In her statement, the teen expressed frustration that the government earlier took her to a Christian pregnancy center, where workers urged her to carry the pregnancy to term.

“They made me see a doctor that tried to convince me not to abort and to look at sonograms,” she said. “People I don’t even know are trying to make me change my mind.”

Democrats in Congress have pressed Eric Hargan, acting secretary for the Department of Health and Human Services, about why the Trump administration changed federal policy to block access to abortions for minors in custody.

HHS, which is responsible for caring for detained unaccompanied minors, has said the government is trying to “promote child birth and fetal life.” Scott Lloyd, who directs the agency’s Office of Refugee Resettlement, has personally intervened to try to persuade unaccompanied minor girls not to have abortions, according to HHS.

HHS officials did not respond to multiple requests for comment Wednesday. Lloyd is slated to testify Thursday before the House Judiciary Committee’s subcommittee on immigration and border security on unrelated immigration issues. He could also be asked about the abortion case.

The D.C. Circuit’s ruling on Tuesday to allow the abortion was opposed by the court’s three active judges nominated to the bench by Republican presidents. Judge Brett M. Kavanaugh said the majority had created a new right for undocumented immigrant minors in custody to “immediate abortion on demand.”

Judge Karen LeCraft Henderson went further in a separate dissent finding that the undocumented teenager had no constitutional right to an elective abortion. “To conclude otherwise rewards lawlessness and erases the fundamental difference between citizenship and illegal presence in our country,” she wrote.

Attorneys for the undocumented teenager had asked the full appeals court to rehear her case after the three-judge panel ruled 2 to 1 to give HHS until Oct. 31 to find a sponsor to take custody of the girl. That would have allowed her to be released and to seek the abortion without government involvement.

Government lawyers told the court that prospective sponsors had inquired about the teenager. But the girl’s lawyers on Sunday filed a sworn statement from the former ORR director during the Obama administration who said the vetting process could take weeks or months.

Matt Zapotosky and Robert Barnes contributed to this report.