WASHINGTON — Defense Secretary Jim Mattis late Tuesday announced that transgender troops will be allowed to continue serving in the military pending the results of a study by experts.

The announcement follows an order from President Trump — first announced in a tweet — declaring that transgender service members can no longer serve in the military, effectively reversing an Obama administration policy. The order also affects the Department of Homeland Security, which houses the Coast Guard.

"Once the panel reports its recommendations and following my consultation with the secretary of Homeland Security, I will provide my advice to the president concerning implementation of his policy direction," Mattis said in the statement. "In the interim, current policy with respect to currently serving members will remain in place."

Mattis' move buys time for the Pentagon to determine how and if it will allow thousands of transgender troops to continue to serve, whether they will receive medical treatment, or how they will be discharged.

As Defense Secretary, Mattis has emphasized that he has little tolerance for policies that detract from military readiness or the Pentagon's effectiveness on the battlefield. At the last moment in June, he delayed the Pentagon's plan to accept new transgender troops. His reasoning: He demanded more study to determine the effect of recruiting them on the Pentagon's ability to fight and win wars.

Under the Obama administration, the Pentagon rescinded a longstanding ban on transgender troops from serving. It also outlined how those troops could receive medical treatment, including gender reassignment surgery, if it was deemed medically necessary.

Trump's order by tweet on July 26 caught the Pentagon by surprise. The tweets said there was no room in the ranks for transgender troops and that the government would no longer pay for their medical treatment.

Marine Gen. Joseph Dunford, chairman of the Joint Chiefs of Staff, responded by saying that the Pentagon would not change its policy until it was notified officially by the White House.

The president issued that notification Friday night. It directed Mattis to study the issue and determine how to implement Trump's direction. It was assailed by advocates for transgender troops who called it discriminatory, and the American Civil Liberties Union has filed suit against it.

Last year, the Pentagon commissioned a study by the non-partisan RAND Corp. to examine the effects on military readiness of allowing transgender troops to serve openly and the cost of providing them medical treatment. The study estimated that a few to several thousand transgender troops are on the active duty force of 1.3 million. Researchers found that paying for their health care needs would amount to about $8 million per year and their effect on readiness would be negligible.

More:

Trump orders Pentagon to reverse transgender policy

Transgender service members doubt Trump can kick them out