WASHINGTON — New guidance released Friday by the Pentagon makes it clear that any transgender troops currently in the military can re-enlist in the next several months, even as the department debates how broadly to enforce a ban on their service ordered by President Donald Trump.

In a memo to top military leaders, Defense Secretary Jim Mattis said a high-level panel will determine how to implement Trump’s ban on transgender individuals in the military. Trump directed the military to indefinitely extend the ban on transgender individuals enlisting in the service, but he left it up to Mattis to decide if those currently serving should be allowed to stay.

Members of Congress have already sent a letter to Trump calling on him to reconsider the ban.

READ MORE: Fact-checking Trump’s reasons for a transgender military ban

Sen. John McCain, the Republican chairman of the Senate Armed Services Committee, said Friday he backed legislation that would bar the Trump administration from forcing transgender troops out of the armed forces.

McCain of Arizona said in a statement that any service member, including those who are transgender, who meets the standards for military readiness and medical fitness 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.

The bill is an attempt to establish protections for transgender troops in law, cutting off Trump’s efforts to kick service members out based on their gender identity. Trump tweeted in July that he would ban transgender troops from serving anywhere in the U.S. military. The directive caught the Pentagon flat-footed as defense officials struggled to explain what they called Trump’s guidance.

About a month later the president issued more formal instructions, directing the Pentagon to indefinitely extend a ban on transgender individuals joining the military. But Trump also gave Mattis six months to come up with a policy on how to address those currently serving, leaving the door open to permitting their continued service.

READ MORE: The lawsuits challenging Trump’s ban on transgender troops, explained

Mattis has said the Pentagon will develop a plan that “will promote military readiness, lethality and unit cohesion.”

In his memo released Friday, Mattis said the deputy defense secretary and the vice chairman of the Joint Chiefs will lead a panel that will determine how the department will implement the ban. Outside experts may be included to provide additional advice. The Pentagon refused to release the memo, but provided a summary.

According to the Pentagon, Mattis made clear in his memo that the current policies on transgender troops remain in effect. He said transgender individuals can continue to serve in the military and continue to receive any required medical care.

The issue raises a number of thorny legal questions, such as whether the Pentagon can say in 2016 that transgender individuals can serve openly and then a year later threaten to throw out anyone who came out publicly.

That interim guidance laid out in the memo will stay in effect until Feb. 21, when the Pentagon must complete its final plan on how and when transgender individuals may serve in the military.

The Obama administration in June 2016 changed longstanding policy, and declared that troops could serve openly as transgender individuals. And it set a July 2017 deadline for determining whether transgender people could be allowed to enter the military. Mattis delayed any decision on enlistments until Jan. 1, 2018. But that plan was upended when Trump tweeted in July that transgender individuals were not welcome in the armed forces.

Since then, officials have been working to figure out a new policy, including whether transgender troops currently in the military should be thrown out. Many of them have been deployed to warzones multiple times.

READ MORE: ‘Maybe I should just stay closeted’ — Trans troops weigh their options

The issue raises a number of thorny legal questions, such as whether the Pentagon can say in 2016 that transgender individuals can serve openly and then a year later threaten to throw out anyone who came out publicly.

The bill supported by McCain is also sponsored by Sens. Kirsten Gillibrand, D-N.Y., and Jack Reed of Rhode Island, the top Democrat on the Armed Services panel, and Republican Sen. Susan Collins of Maine.

Gillibrand said she had planned to offer the measure protecting transgender troops as an amendment to the annual defense policy bill the Senate has been considering over the last several days. But she said the Senate’s Republican leadership “cut off debate” and blocked the amendment from getting a vote.

“Thousands of brave transgender Americans love our country enough to risk their lives for it, fight for it, and even die for it, and Congress should honor them and let them serve,” said Gillibrand, who thanked McCain for his support.

The legislation also requires Mattis to complete his policy review by end of the year and to provide the results to Congress.