Image copyright Reuters

The US Supreme Court has quashed a court ruling that let an undocumented migrant teen obtain an abortion while she was in US custody last year.

Authorities gave the 17-year-old the choice to either not have an abortion, or accept deportation and terminate her pregnancy elsewhere.

A federal appeals court ruled on 24 October last year that she had the right to an abortion.

The procedure was carried out early the next morning.

The US Department of Justice had been preparing to appeal to the Supreme Court when it learned the teenager had already had the abortion.

In a unanimous five-page opinion on Monday, the justices struck down the lower court ruling.

Because it eliminates a lower court precedent that could have applied in similar cases, the verdict was seen as a victory for the Trump administration.

However, the Supreme Court also allowed litigation to proceed in lower courts for other detained immigrants in such situations.

The justices also rejected calls by Trump administration lawyers for disciplinary measures against the teenager's defence team.

They accused the American Civil Liberties Union (ACLU) of rushing ahead with the abortion and denying them the chance to fight the lower court ruling.

The woman - who came from Central America and is named as "Jane Doe" in legal documents - is now out of immigration detention and has been living with a sponsor family.

She was taken into custody after entering the US illegally.

According to the ACLU, the current policy affects hundreds of girls that are being held in US immigration facilities, many of them awaiting deportation.+