(Photo by Spencer Platt/Getty Images)

The Pentagon has paid for the gender-affirmation surgery of an active duty servicemember, despite President Trump attempting to ban transgender people from serving openly in the military.

The trans woman is an infantry soldier who got her Combat Infantry Badge in Operation Anaconda in Afghanistan in 2003, a Defense Department source told NBC.

Vice Admiral Raquel Bono, head of the Defense Health Agency, approved a waiver for the surgery to go ahead on Monday, according to sources.

According to NBC, the surgery will take place at a civillian hospital.

The Pentagon in September issued new guidance which temporarily allowed trans troops to re-enlist in the military until it is determined how the controversial ban will be enforced.

Defence Secretary Jim Mattis said in a memo to top Pentagon officials that current policies on serving trans troops remain in fact.

This means that current trans troops are permitted to continue their service with full access to healthcare.

However, in the memo, which has not been released but summarised, Mattis said that the relax on the ban is only temporary until policies can be finalised.

Related: How can Donald Trump’s transgender military ban be stopped?

The temporary guidance will stretch until February 21, when a final policy on the trans troop ban is reached by the Pentagon.

It comes as Trump directed the military to ban trans individuals from enlisting, but allowed Mattis to decide the fate of currently serving transgender personnel.

National Press Secretary for The Human Rights Campaign, Sarah McBride, said that it was “clear” that “there is broad opposition within Congress and military leadership to Donald Trump and Mike Pence’s discriminatory attacks on transgender troops”.

“Donald Trump’s erratic July tweets – and the subsequent half-baked orders – have left the lives and careers of thousands of transgender service members in question.

“There is only one right answer here, and that is allowing any person willing and able to serve to do so. And we will not relent in our efforts to make that a reality,” McBride added.

Related: No, Defense Secretary James Mattis is not trying to stop Donald Trump’s transgender troop ban

Republican Senator John McCain along with other Members of Congress have sent a letter to President Trump asking him to retract the ban.

Senator McCain, who is the chairman of the Senate Armed Services Committee, said in a statement that any service member regardless of their gender identity should be permitted to serve.

“When less than 1 percent of Americans are volunteering to join the military, we should welcome all those who are willing and able to serve our country,” McCain said.

McCain has backed legislation which would establish protections for trans troops and would prevent Trump’s ban which he announced in July on Twitter.