Active-duty transgender troops say a policy change that puts them at risk of being removed and indefinitely bars transgender people from enlisting in the military is a step backward for civil rights that will promote inequality in the armed forces.

President Donald Trump on Friday directed the Pentagon to extend a ban on transgender individuals joining the military but gave the Pentagon the authority to decide the future of openly transgender people already serving. Trump appeared to leave open the possibility of allowing some transgender people who already are in uniform.

The guidance from the White House contradicts Trump's words, Army Capt. Jennifer Sims said, pointing out that he just praised the military for its tolerance when he told veterans in Nevada on Wednesday that those in uniform come from all walks of life and are united by shared values and a shared sense of duty. Sims spoke to The Associated Press on her own behalf and not on behalf of the Army.

Days earlier, Trump, speaking to thousands of soldiers at the Army's Joint Base Myer-Henderson Hall, in Arlington, Virginia, denounced prejudice, bigotry and hate in the wake of violence that erupted at a rally organized by white supremacists in Charlottesville, Virginia.

"It's going to create this situation where there is a complete inequality in how transgender troops are treated," said Sims, 28, who is based in Germany and is taking pills to prepare for her transition surgery.

That is not the military's problem, said Elaine Donnelly, president of the Center for Military Readiness, which has opposed allowing transgender people to serve.

"The armed forces are not just another equal opportunity employer," Donnelly said in a statement.

The military's limited funds, she added, should not be used "to indulge transgender demands."

Transgender people have been allowed to serve openly in the military since June 2016. Trump, in a series of tweets on July 26, announced that he planned to end that policy.

The government "will not accept or allow transgender individuals to serve in any capacity in the U.S. military," he tweeted, contending that their service entailed "tremendous medical costs and disruption."

A 2016 study by the RAND Corp. estimated it would cost the military $2.4 million to $8.4 million a year to provide gender transition-related coverage, an increase of 0.04 percent to 0.13 percent in health care spending for active-duty members. Researchers estimated 29 to 129 active-duty service members annually would seek such treatment.

Meanwhile, it would cost hundreds of millions of dollars to discharge thousands of transgender personnel, according to a study released this month by the Palm Center, an independent research institute.

The new guidance, as described by an official familiar with its contents but not authorized by the White House to discuss it publicly, appears to be less rigid than the complete ban that Trump tweeted about.

The official said the guidance puts a stop to recruitment of transgender individuals and prohibits the use of federal funds to pay for sexual reassignment surgery, except in cases where it's deemed necessary to protect the health of an individual who has already begun the transition. But it would give Defense Secretary Jim Mattis six months to determine circumstances in which those currently in uniform who are openly transgender might be permitted to continue serving.

Jennifer Levi, an attorney with the LGBT-rights group GLAD, said that current policy "requires equal treatment of transgender service members, including that they are subject to the same standards of deployment as other soldiers."

GLAD and another LGBT-rights organization this month sued in U.S. District Court in Washington on behalf of five transgender service members with nearly 60 years of combined military service. They had hoped to get a swift court decision on Trump's tweet that could prevent a ban from taking effect.

"Any special or different rule for transgender soldiers is discrimination, plain and simple," she said. "It also harms the military and, ultimately, the safety of our nation."

Trump has argued that the military should not pay for medical care for transgender service members to transition to another gender, and that the process means they cannot be deployed, harming the readiness of the armed forces.

Service members say that is not true.

According to the policy adopted under the Obama administration, commanders have the discretion to decide when to allow transgender troops to start their treatment to transition to a different gender to ensure that it does not disrupt operations. Commanders can also decide whether a person undergoing treatment is still fit to be deployed.

Army Capt. Jennifer Peace, a transgender woman based at Joint Base Lewis-McChord in Washington state, said that she deployed to Afghanistan in 2012 while transitioning, and that there are other transgender troops serving there now.

"Being transgender had had absolutely no impact on my fitness for duty," Peace said, adding that "there should be no transgender standard — there should be an Army standard. If I can make the Army standard, I should be able to serve."

Many health reasons can delay deployment, including pregnancy, knee or gall bladder operations, and laser eye surgery. Soldiers may also reschedule their treatments if they see it could have a negative effect on their unit.

If the military won't pay for their medical care, many transgender troops say, they will find a way to cover the costs.

Navy Lt. Cmdr. Blake Dremann, who is president of SPARTA, a trans advocacy group, said he is telling concerned service members to wait for any legal challenges to play out and "continue to succeed, show them we're not an issue."

"Which we haven't been, so I don't understand," said Dremann, 36.

Air Force Staff Sgt. Ashlee Bruce, 26, who works at Buckley Air Force base in Aurora, Colorado, and plans to start medical treatment next month to transition, plans to speak out but won't go to court after taking an oath to respect the commander in chief's orders.

"I want to stay in the military as long as they will have me," Bruce said. "I love what I do. I think we make a positive impact day in and day out protecting our country and defending our way of life."

McDermott reported from Providence, Rhode Island. AP National Writer David Crary in New York and AP National Security Writer Robert Burns in Washington contributed to this report.