Military flag bearers prepare to march in the San Diego LGBT Pride parade in July. (David Maung/European Pressphoto Agency)

Defense Secretary Jim Mattis left the door open Monday to some transgender service members continuing to serve in the U.S. military, three weeks after President Trump said that they would not be allowed to do so “in any capacity.”

Mattis, speaking to reporters at the Pentagon, said that he and his staff are still studying the issue, including how having transgender service members affects other members of their units.

The Pentagon chief, asked whether transgender people now in the military will be forced out of their service, pointed to a statement that Gen. Joseph F. Dunford Jr., the chairman of the Joint Chiefs of Staff, issued a day after Trump’s announcement last month. Dunford said that openly transgender people will be allowed to continue to serve until there is guidance from the president on how to proceed.

“The chairman immediately went out and said immediately, ‘Everyone stand fast until we get the direction,’ ” Mattis said. “I understand that this is probably more about your suspicion about what could be coming, but the fact is, we have received no direction that would indicate any harm to anybody right now.”

Mattis declined to say whether transgender service members who have outed themselves will be allowed to, at minimum, complete their military contracts. He also questioned the numbers of a study by the Rand Corp. that was commissioned by the Pentagon and cited by the Obama administration as it lifted a ban on transgender service in July 2016. The study found that there was little impact to military operations on allowing transgender troops and that there were already between 2,500 and 7,000 transgender people among the 1.3 million on active duty.

“I’m going to wait, again, until I get the direction from the White House, and then we will study it and come up with what the policy should be,” the secretary said. “But I’m not willing to sign up for the [Rand Corp.] numbers you just used, and I’m not willing to sign up for the concern any of [the transgender service members] have, considering what the chairman said. And I’m not willing to prejudge what the study will now bring out.”

The Rand study has been derided by opponents to transgender military service as fodder that allowed then-Defense Secretary Ashton B. Carter to introduce more social engineering to the military because it found that there would be little impact on U.S. military operations. Officials with Rand, asked to comment Monday night, said they were consulting with each other before speaking.

Aaron Belkin, a sociologist who assisted the Pentagon with transgender research, said that the Rand study reached the same conclusion “as all of the rest of the research” about military service by people who are lesbian, gay, bisexual or transgender. The study also confirmed lessons by 18 other foreign militaries that allow transgender people to serve, and those of who had served openly and honorably in the U.S. military for the last year, he added.

Belkin compared banning transgender people now to the “don’t ask, don’t tell” ban that prohibited gay people from serving in the military for years until it was repealed during the Obama administration.

“Secretary Mattis should explain to the president and the public that he understands this lesson, and that forcing the military to adopt ‘don’t ask, don’t tell’ for transgender troops would waste money, disrupt the forces, and lead to years of litigation, the very same consequences as the first ‘don’t ask, don’t tell.'”

But Elaine Donnelly, the president of the Center for Military Readiness, said that government policies and statutes change all the time, and “it simply can’t be true that once a benefit is established, a qualification imposed, or a disqualification removed it can never be re-imposed or otherwise altered.”

Donnelly, who also opposed integrating women in combat units and allowing gay people to serve openly in the military, said all of the transgender policy changes that the Obama administration made will be in effect unless Trump and Mattis issue new orders by Jan. 1.

“I believe they will, but orders will have to be principled, consistent, and defendable in court,” she said. “Any exceptions would be narrow, few, and temporary as new policies putting military readiness take effect.”

Trump doubled down on his July 26 announcement that he was banning transgender service last week, saying he did the military a “great favor” by doing so.

The Obama administration lifted its ban on transgender military service in July 2016 and set a one-year deadline at the time to determine a policy for bringing in transgender people who want to serve. But on the eve of that deadline, Mattis said he wanted the Pentagon to have an additional six months to study the issue, citing a need to determine how allowing transgender service will affect “the readiness and lethality of the force.”

Mattis said Monday that there was another factor in the decision, as well — the lack, at the time, of political appointees overseeing personnel issues at the Pentagon. He said he wanted to “get them in to be able to answer those questions” that arose among senior military officials.

The secretary declined to answer why Trump chose to disclose the decision on Twitter and without specific policy in place.

“You all elected — the American people elected — the commander in chief,” Mattis said of Trump. “They didn’t elect me. So the commander in chief in our country, in our system of government, is elected by the people, and he has that authority and responsibility.”