The Trump administration has fought in court to prevent a 17-year-old held in a Texas facility for unaccompanied immigrant children from having an abortion. In a case that's stirred strong emotions on both sides of the abortion debate, a federal appeals court on Tuesday cleared the way for the girl to obtain the abortion despite objections from federal and Texas officials.

Here's a look at some of the background to the dispute:

___

WHAT ARE THE ABORTION RIGHTS OF WOMEN IN FEDERAL CUSTODY?

Women in federal prisons and immigrant women detained by U.S. Immigration and Customs Enforcement are entitled to obtain an abortion, though in most cases they must do so without federal financial assistance. ICE will assume the costs in cases of rape or incest, or when the mother's life would be endangered by carrying a fetus to term.

ICE said it had 525 pregnant women in custody at various points in the 2017 fiscal year; it said it did not have figures on how many had abortions while being held.

___

IS THE SITUATION DIFFERENT FOR MINORS?

Immigrant minors placed in federal custody for entering the country illegally — such as the pregnant teen in Texas — are put in the care of the Department of Health and Human Services, which contends that pregnant girls in this situation do not have a constitutional right to abortion. HHS says decisions should be made "in the best interests of the child," which might include trying to prevent the girl in question from obtaining an abortion.

In a recent court motion, HHS said it had a "policy of refusing to facilitate abortions, including by committing staff and other resources, except in very limited circumstances." In the case of the pregnant teen, identified in court papers as Jane Doe, HHS had said she could choose to go back to her country of origin, but a government lawyer later acknowledged that abortion is not permitted in the Central American country she comes from.

___

DOES TEXAS LAW COME INTO PLAY SINCE THE TEEN IS HELD AT A FACILITY THERE?

Texas has enacted many restrictions on abortion access, including a requirement that unmarried girls under 18 need parental permission to get an abortion. However, the teen in this case has obtained a judicial waiver exempting her from this requirement. Her supporters say she also has arranged for funding and travel assistance so that an abortion would not require taxpayer funding.

The girl is believed to be about 15 weeks pregnant; Texas law bans most abortions after the 20th week of pregnancy.

___

WOULD AN ABORTION FOR THIS TEEN PROMPT MORE GIRLS TO COME TO THE U.S. ILLEGALY TO GET ABORTIONS?

Both HHS and Texas Attorney General Ken Paxton, as well as anti-abortion activists, contended that a court victory for the teen would have this result.

"Countless others undoubtedly would follow," Paxton argued. "Texas must not become a sanctuary state for abortions."

Abortion-rights advocates have ridiculed this argument, saying the chance of getting an abortion in the U.S. was unlikely to be the motive for a woman or girl to undergo the hardships and dangers of illegal passage to the U.S. Dr. Anjani Kolahi, a family medicine physician in Albuquerque, New Mexico, and a fellow with Physicians for Reproductive Health, noted that abortions are available in Mexico, despite bans in many of its states. The procedure is legal in Mexico City and the abortion pill is widely accessible for use in self-induced abortions.