The action by the justices provided a legal victory to Trump's administration even though the teenager already has had the abortion because it eliminated a precedent at the federal appeals court level that could have applied in similar circumstances in which detained minors sought abortions.
In the unsigned opinion with no dissents, the justices threw out the appeals court decision on the grounds that the dispute became moot once the unnamed teenager had the abortion.
The justices, however, declined to take up the administration's request for disciplinary action against the American Civil Liberties Union lawyers who represented the girl, who underwent an abortion in Texas last October.
The administration had accused the ACLU lawyers of misleading the Justice Department over when she would have the abortion. The high court said that it takes misconduct allegations against lawyers seriously but said "not all communication breakdowns constitute misconduct."
The justices also allowed litigation to continue in lower courts concerning other detained immigrants in detention in a similar situations.
The Trump administration had argued that while the girl was in federal custody, she was subject to its policy of refusing to facilitate abortions. The girl, whose name and nationality were not disclosed, went by the name of "Jane Doe" in legal papers.
While the case was pending at the Supreme Court, litigation continued in lower courts.
On March 30, a federal judge in Washington issued an injunction preventing the administration from impeding access to abortion by detained immigrant minors. US District Judge Tanya Chutkan also certified a class action of similar minors to challenge the administration's policy.
'Strike It Down'
"Today's decision doesn't affect our ongoing efforts to ensure that all 'Janes' can get an abortion if they need one," said ACLU attorney Brigitte Amiri. "The district court has blocked the Trump administration's cruel policy of obstructing unaccompanied immigrant minors' access to abortion while the case continues, and we won't stop until we strike it down once and for all."
The ACLU, which has filed a range of lawsuits against the administration, sued in Washington in October, seeking a decision on obtaining abortions that would be binding in any future cases that arise.
A 1973 Supreme Court ruling legalized abortion nationwide. One of the issues raised by the current case is whether illegal immigrant women have the same right to an abortion as American citizens and legal residents.
The case involves the intersection of two divisive social issues on which Trump has taken a hard line: abortion and immigration.
The girl at the center of the legal fight had an abortion on October 25, the day after a US appeals court ruled against the Trump administration's objections.
The Justice Department has said it was preparing to appeal that ruling to the Supreme Court when it learned she had already had the abortion early that morning.
She entered the United States without any family in September 2017 and was immediately detained by US authorities and placed in a shelter in Texas for unaccompanied illegal immigrant minors.
She had sought and received a Texas court order to approve the abortion because she a minor, and had scheduled a sonogram and consultation with a physician, as required by Texas law. But the Trump administration refused to let her leave the detention center to carry out those steps.
At the time of the abortion, she was around 15 weeks pregnant. Under Texas law, abortions after 20 weeks are illegal.