Trump’s surprise announcement, in a series of Twitter posts on Wednesday, drew condemnation from rights groups and some lawmakers in both US political parties as discrimination with purely political motives. But it was praised by conservative activists and some Republicans.

The action, reversing Democratic former President Barack Obama’s policy, halted years of efforts to eliminate barriers to military service based on sexual orientation or gender identity.

Related reading

Trump bans transgender people from US military
President Donald Trump announced Wednesday that transgender people may not serve 'in any capacity' in the US military, citing the "tremendous medical costs and disruption" their presence would cause.

The Canadian military’s social media response to Trump’s move was reminiscent of a tweet by Canadian Prime Minister Justin Trudeau in January after Trump issued a travel ban affecting people from Muslim-majority countries.