WASHINGTON — The U.S. Supreme Court agreed Monday to toss out a lower court ruling that allowed a 17-year-old woman from Mexico to seek an abortion at an outside medical clinic while she was held in federal custody at a detention facility in Texas.

The Trump administration urged the justices to vacate the ruling, an action that wipes out any value as legal precedent for other pregnant women in custody. The Justice Department also claimed that lawyers for the woman misled the government about when she would get the procedure.

The woman crossed the southern border on her own in September 2017, unaccompanied by relatives, and was taken into custody. After a medical examination revealed that she was pregnant, she sought an abortion. Texas authorities gave her permission, but the Department of Health and Human Services, which runs the detention facility, refused.

With the help of the ACLU and her legal guardian, she sued, and a federal judge in Washington said immigrant women in federal custody have the same right of access to an abortion as U.S. citizens. The judge ordered the government to present her to a clinic for treatment. The federal appeals court in Washington ultimately agreed, issuing its ruling October 24.

Texas law requires a woman to attend a counseling session with her abortion doctor at least 24 hours before the procedure. The woman in the case, identified in court documents only as Jane Doe, attended such a briefing Oct. 19. But the doctor who counseled her did not appear to be available to perform the abortion.

Based on that development, according to the Justice Department, the ACLU told government lawyers the abortion would be performed by a different doctor on Oct. 26, after another counseling session. The government said it planned to ask the Supreme Court early on the 26th to block the abortion.

But it turned out the original doctor became available after all, and Jane Doe received the abortion early on Oct. 25.

"The ACLU misled the United States as to the timing of Jane Doe's abortion," the Justice Department said, "thereby thwarting Supreme Court review." It urged the court to discipline Jane Doe's lawyers.

But David Cole, the ACLU's legal director, said there was no attempt to mislead, even though the Trump administration blocked her from getting constitutionally guaranteed care for a month.

"After the courts cleared the way for her to get her abortion, it was the ACLU's job to see that she wasn't delayed any further, not to give the government another chance to stand in her way," Cole said.

In Monday's order, the court declined to discipline the ACLU lawyers.