A federal judge in Washington DC has blocked Donald Trump's attempt to prohibit transgender Americans from serving in the military.

Mr Trump in August signed an executive order banning transgender people from serving openly, reversing Barack Obama’s directive allowing them to do so. The move prompted a flood of lawsuits, many of them filed on behalf of transgender service members or veterans.

Now one of those legal challenges has borne fruit. United States District Judge Colleen Kollar-Kotelly sided in part with a group of transgender servicemembers who sued to block the change, halting Mr Trump's ban on service but upholding the President's move to block the military from paying for gender reassignment surgery.

“This is a complete victory for our plaintiffs and all transgender service members, who are now once again able to serve on equal terms and without the threat of being discharged”, National Center for Lesbian Rights Legal Director Shannon Minter, whose organisation filed the lawsuit, said in a statement. “We are grateful to the court for issuing such a clear, powerful decision recognizing that there is no legitimate reason for treating qualified transgender service members differently than others”.

The prohibition was already effectively on hold while Secretary of Defense James Mattis convened a panel of experts to examine the implications of reinstating the ban, a move Mr Mattis said in August would mean “current policy with respect to currently serving members will remain in place”.

A 2016 study conducted by the RAND corporation at the Obama administration’s behest concluded that allowing transgender people to serve would have “minimal impact” on troop readiness. It also suggested that the cost of covering gender-transition related healthcare would be negligible, amounting to between $2.4 million and $8.4 million annually.

Lonely road: Why school is hell for transgender pupils Show all 2 1 /2 Lonely road: Why school is hell for transgender pupils Lonely road: Why school is hell for transgender pupils Many schools experience difficulties when faced with a pupil who does not fit neatly in to the 'boy' or 'girl' box © Alamy Lonely road: Why school is hell for transgender pupils Urgent reform: Stephen Whittle, a transgender professor, is pushing for greater protection of trans pupils in schools © Warren Smith

But Ms Kollar-Kotelly’s decision shows Mr Trump is on contested legal ground regardless of the outcome of the expert analysis.

In her opinion, the judge wrote that transgender troops had a reasonable claim to their 5th Amendment rights being violated because Mr Trump’s directive affects them as a “class of historically persecuted and politically powerless individuals”.