WASHINGTON — President Trump late Friday ordered the Pentagon to reverse the Obama administration policy on transgender troops, reverting to the ban on transgender service members that was in place prior to 2016.

Trump also halted spending on medical treatment for troops transitioning to the other sex unless such a move would endanger the service member's health. The order also affects the Department of Homeland Security, which contains the Coast Guard.

Trump, in the order, said the Obama administration "failed to identify a sufficient basis to conclude that terminating the Departments' longstanding policy and practice would not hinder military effectiveness and lethality, disrupt unit cohesion, or tax military resources." Further study is needed to ensure the policy would not have those effects, he wrote.

The guidance to the Pentagon came in the form of a presidential memorandum, a form of directive that carries equal weight as an executive order. And it was addressed both to the secretary of Defense and the secretary of Homeland Security, making clear that the policy applies to the Coast Guard as well.

More:Trump's ban leaves transgender troops in limbo, and his White House and Pentagon scrambling

More:Transgender service members doubt Trump can kick them out

Advocates for transgender troops expressed outrage Friday.

"A billion-dollar witch hunt targeting thousands of current service members will not save the taxpayers money or strengthen the military but will cause disruptions and undermine military readiness, just as the failed ‘don’t ask, don’t tell’ policy did," said Aaron Belkin, director of the Palm Center. Don't Ask, Don't Tell was the military's policy that had prohibited gay and lesbian troops from serving.

Trump surprised the Pentagon on July 26 when he announced in three early morning tweets that he intended to overturn the Obama-era policy that allowed transgender troops to serve openly and receive treatment and called for the Pentagon to begin accepting new transgender troops this year.

“Our military must be focused on decisive and overwhelming victory and cannot be burdened with the tremendous medical costs and disruption that transgender in the military would entail,” he tweeted.

Marine Gen. Joseph Dunford, the chairman of the Joint Chiefs of Staff, responded by saying the policy would not change until the Pentagon had received official notification from the White House. That notice came Friday.

Pentagon spokesman Dana White said in a brief statement the guidance had been received and more information would be forthcoming. In signing the order, Trump also left open the possibility that he could be persuaded on the issue. He instructed that the transgender ban remain in place until the secretary of Defense “provides a recommendation to the contrary that I find convincing.”

The order temporarily protects transgender people already serving in the military, directing that “no action may be taken against such individuals” until the secretary of Defense comes up with an implementation plan.

The White House released the order late on a Friday — a longstanding Washington tactic to bury unpleasant news — hours after Trump and his family left for the presidential retreat at Camp David.

The RAND Corp., a non-partisan think tank commissioned by the Pentagon to study the issue of transgender troops, found last year that only a few hundred of the estimated 6,600 transgender troops would seek medical treatment in any year. RAND found those costs would total no more than $8 million per year.