Their futures will now be decided by Secretary of Defense James Mattis.

Several senior military officials had voiced unease over the policy shift, with the head of the Coast Guard saying he would not "break faith" with transgender personnel.

He said there were 13 Coast Guard members who have come out as transgender, noting "all of them are doing meaningful Coast Guard work today".

A day after the president's initial announcement, General Joe Dunford, the Chairman of the Joint Chiefs of Staff, sent a short memo to senior officers and enlisted leaders that the current policy should remain in effect until Mr Trump gives formal direction to the Pentagon and Mr Mattis issues new guidance.

"In the meantime, we will continue to treat all of our personnel with respect," Mr Dunford wrote.

Five transgender women in the US military are suing Mr Trump and the Pentagon over the tweets, saying they faced uncertainty about their futures, including whether they would be fired or lose post-military and retirement benefits.

Mr Trump has said he did the Pentagon a "great favour" by banning transgender troops, saying the issue had been "complicated" and "confusing" for the military.

In the directive he suggested Mr Obama had not thought through whether the policy would "hinder military effectiveness and lethality, (or) disrupt unit cohesion."