WASHINGTON — An active-duty service member has received gender-reassignment surgery, the Pentagon said Tuesday, amid ongoing debate over whether transgender troops should be allowed to continue to serve in the military,

Defense Department spokeswoman Dana White said the surgery was done Tuesday in a private hospital and was paid for by the military's health coverage because the doctor deemed it was medically necessary.

"''Military hospitals do not have the surgical expertise to perform this type of surgery, therefore it was conducted in a private hospital," White said, adding that because this service member "had already begun a sex-reassignment course of treatment, and the treating doctor deemed this surgery medically necessary, a waiver was approved by the director of the Defense Health Agency."

Army Maj. Dave Eastburn said that waivers are required and routinely approved for medical procedures that military facilities don't have the expertise to perform.

The surgery was first reported by NBC News.

The Obama administration last year eliminated the longstanding ban on transgender individuals serving in the military. But President Donald Trump tweeted in July that the federal government "will not accept or allow" transgender troops to serve "in any capacity" in the military. He followed that a month later with a formal order telling the Pentagon to extend the ban. He gave the department six months to determine what to do about those currently serving.

Trump also directed Defense Secretary Jim Mattis to halt the use of federal funds to pay for sexual reassignment surgeries and medications, except in cases where it is deemed necessary to protect the health of an individual who has already begun the transition.

In September, Mattis sent out a memo making clear that transgender service members can continue to enlist, as the Pentagon grapples with how to implement Trump's ban. A high-level panel is studying the issue, and Trump's order was quickly condemned by key members of Congress and has been challenged in court.

A federal judge last month barred the Trump administration from proceeding with the plan.

Because the ban on transgender service members was only removed last year, gender reassignment surgeries have so far been relatively rare.

The Pentagon did not provide additional details on Tuesday's surgery, due to privacy restrictions.