President Donald Trump on Friday signed a memo effectively barring transgender people from joining the US military, but left the fate of those already serving up to the Pentagon.

In a widely anticipated move, aides said Trump directed the military "to return to the longstanding policy and practice on military service by transgender individuals prior to June 2016."

That means an effective ban on new openly transgender personnel and on payment for treatment for those already in the armed forces.