WASHINGTON (Reuters) - The Pentagon said on Tuesday it had paid for gender-reassignment surgery of an active-duty service member that took place earlier in the day, as the issue of transgender troops serving in the U.S. military continues to garner national attention.

U.S. President Donald Trump tweeted in July that he would ban transgender people from the military, a move that would reverse Democratic former President Barack Obama’s policy of accepting them and halt years of efforts to eliminate barriers to military service based on sexual orientation or gender identity.

Since then however, Trump's policy on transgender service members has faced setbacks.

Last month, a federal judge in Washington blocked Trump from banning transgender people from serving in the U.S. military, handing a victory to transgender service members who accused the president of violating their constitutional rights.

Trump signed a memo which called on Defense Secretary Jim Mattis to submit a plan to the President by Feb. 21 on how to implement the changes, and the Pentagon has created a panel of senior officials for that purpose.

In the meantime, the current policy, including allowing transgender people to serve remains in force.

"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," Pentagon spokeswoman Dana White said in a statement.

She added that the surgery was carried out in a private hospital because military hospitals did not have the expertise.

The surgery was paid for by Department of Defense because it was deemed necessary for the well being of the service member.

Such procedures are rare in the U.S. military.

Last year, then-Defense Secretary Ash Carter cited a study by the RAND Corporation saying there were about 2,500 transgender active-duty service members and 1,500 reserve transgender service members.

Rand’s figures were within a range, which at the upper end reached 7,000 active duty forces and 4,000 reserves.

The same study estimated that the cost of gender-transition in the military would increase costs by between $2.4 million and $8.4 million annually, a negligible amount.

(Reporting by Idrees Ali; Editing by Michael Perry)