WASHINGTON (Reuters) - A 17-year-old illegal immigrant in federal custody in Texas can have an abortion immediately despite the objections of President Donald Trump’s administration, a U.S. appeals court decided on Tuesday in a ruling spearheaded by Democratic-appointed judges.

The 6-3 ruling by the U.S. Court of Appeals for the District of Columbia Circuit split along ideological lines, with Democratic-appointed judges backing the teenager who requested an abortion and Republican appointees siding with the Republican president’s administration.

“Surely the mere act of entry into the United States without documentation does not mean that an immigrant’s body is no longer her or his own,” Judge Patricia Millett, appointed by Democratic former President Barack Obama, wrote in an opinion supporting the ruling.

After the ruling, her lawyers asked a judge to allow the girl, who is about 15 weeks pregnant, to have an abortion as soon as Wednesday. The judge then issued an order saying the girl should be allowed to go to an abortion clinic “promptly and without delay.”

The appeals court ruling overturned a decision by a three-judge panel of the same court last Friday that had prevented the girl from having an immediate abortion. The administration still could ask the Supreme Court, which has a conservative majority, to hear the case. A Justice Department spokesman said officials are “reviewing the order” and declined to comment further.

Judge Brett Kavanaugh, a Republican appointee, said in a dissenting opinion that the court had embraced “a new right for unlawful immigrant minors in U.S. government detention to obtain immediate abortion on demand.”

Another Republican appointee, Judge Karen Henderson, wrote separately that she had little problem concluding that illegal immigrants do not have a right to have an elective abortion.

“To conclude otherwise rewards lawlessness and erases the fundamental difference between citizenship and illegal presence in our country,” Henderson said.

But Millett wrote that Tuesday’s decision “rights a grave constitutional wrong by the government.” The Supreme Court legalized abortion for Americans in 1973.

The case involves the intersection of two divisive social issues on which Trump has taken a hard line: abortion and immigration. Among the issues the dispute raises is whether illegal immigrant women have the same rights to an abortion as U.S. residents.

The girl, whose nationality has not been disclosed, entered the United States without any family in September and was immediately detained by U.S. authorities and placed in a shelter in Texas for unaccompanied illegal immigrant minors.

‘BASIC DECENCY’

“Every step of the way, the Trump administration has shown their true colors in this case. It’s clear that their anti-woman, anti-abortion, anti-immigration agenda is unchecked by basic decency or even the bounds of the law,” said Brigitte Amiri, an American Civil Liberties Union lawyer who represents the girl.

“No one should have to go to court to get a safe, legal abortion,” Amiri added.

In Friday’s decision, the three-judge panel ruled 2-1 that the girl must delay plans for an abortion while the U.S. Department of Health and Human Services (HHS) signed off on a person who could act as an official U.S. sponsor, allowing her to get the procedure without government involvement.

The administration said in legal papers that while the girl is in federal custody, she is subject to its policy of refusing to facilitate abortions.

“And the government may legitimately express a preference for childbirth over abortion, even if such a preference may have practical effects or limits on a woman’s exercise of her right to an abortion,” the government said.

The teenager had sought and received a Texas court order to approve the abortion because she is under 18, and had scheduled a sonogram and consultation with a physician, as required by state law. But the government refused to let her leave the detention center to carry out those steps.