US President Donald Trump's decision to ban transgender individuals from serving in the armed forces was a military decision, his Press Secretary has said.

Sarah Sanders told a press briefing that the White House will have to work with the Pentagon to decide how to implement the policy,

"Implementation of the policy is going to be something that the White House and the Department of Defense have to work together to lawfully determine and ... I would imagine the Department of Defense will be the lead on that," Ms Sanders said.

A leading US transgender rights advocate has described Mr Trump's decision as "shocking and ignorant".

Aaron Belkin, director of the Palm Center, said: "The President is creating a worse version of 'Don't Ask, Don't Tell.' As we know from the sad history of that discredited policy, discrimination harms military readiness".

Mr Trump's decision has been strongly criticised.

Former US defence secretary Ash Carter said: "To choose service members on other grounds than military qualifications is social policy and has no place in our military".

He added that there were already transgender individuals serving "capably and honourably."

In a series of twitter posts, Mr Trump said that after consulting with generals and military experts, no transgender people will be allow serve in the US military, which he said could not be burdened with "the tremendous medical costs and disruption that transgender in the military would entail".

The top Democrat in the House of Representatives, Nancy Pelosi, noted that a study commissioned by the Pentagon found that the cost of providing medically necessary transition-related care involving transgender service members would amount to one-100th of 1% of the military's healthcare budget.

Once again, President Trump has shown his conduct is driven not by honour, decency, or national security, but by raw prejudice

Earlier this year the Trump administration revoked landmark guidance to public schools letting transgender students use the bathrooms of their choice.

During the 2016 presidential campaign Mr Trump tweeted his support for the LGBT community.

Mr Trump's action today appeared to halt years of efforts to eliminate barriers to military service based on sexual orientation.

The Pentagon last year under Mr Obama announced that it was ending its ban on transgender people serving openly in the military, with officials calling the prohibition outdated.

The Pentagon referred all questions about Mr Trump's decision to the White House.

"We will provide revised guidance to the department in the near future," Defense Department spokesman Navy Captain Jeff Davis said.

The Pentagon had been expected to start allowing transgender people to begin enlisting this year, provided they had been "stable" in their preferred gender for 18 months.

But Defense Secretary Jim Mattis on 30 June approved a six-month delay in allowing transgender recruits to join the military.

American Civil Liberties Union attorney Joshua Block called Mr Trump's action outrageous and desperate, saying the president rejected the "basic humanity" of transgender service members.

"This has been studied extensively, and the consensus is clear: There are no cost or military readiness drawbacks associated with allowing trans people to fight for their country," Mr Block said.

"The president is trying to score cheap political points on the backs of military personnel who have put their lives on the line for their country."

Republican Senator John McCain, who returned to Washington DC last night for the vote on healthcare, said Mr Trump's tweet is "yet another example of why major policy announcements should not be made via Twitter".

He said the statement is unclear as the defence department had already decided to allow currently-serving transgender people to stay in the military.

Senator McCain said there is no reason to force service members who are able to fight, train and deploy to leave the military - regardless of their gender identity.

The US Supreme Court in March scrapped plans to hear a major transgender rights case and threw out a lower court's ruling in favour of a transgender Virginia high school student after Mr Trump rescinded Mr Obama's policy.

The US military's ban on gay people serving openly in the armed forces ended under Mr Obama in 2011 after Congress passed legislation in 2010 reversing a law dubbed "don't ask, don't tell" that had forced thousands of service members out of the military and others to hide their sexual orientation.

The US military at times has been in the vanguard of social progress in the United States, for example Democratic President Harry Truman's racial integration of the armed forces in 1948 before the civil rights battles of the 1950s and 1960s.

The Pentagon under Mr Obama also opened all combat roles in the military to women.

Last year, Mr Obama's defense secretary, Ash Carter, cited a study by the RAND Corporation think tank saying there were about 2,500 transgender active-duty service members and 1,500 reserve transgender service members.

A study by the military published this year in Journal of the American Medical Association Internal Medicine showing that most of its family physicians reported in 2016 that they had not been formally trained to care for transgender individuals.

At least one military medical centre had implemented training for its doctors, however.

The ACLU and the gay and transgender rights group Lambda Legal appealed to transgender service members to contact their lawyers for help.

A leading transgender rights advocate has described the decision as a "shocking and ignorant attack on our military and on transgender troops".

Aaron Belkin, director of the Palm Center, said: "The President is creating a worse version of 'Don't Ask, Don't Tell.' As we know from the sad history of that discredited policy, discrimination harms military readiness".

UK defence chiefs in support of transgender service personnel

Britain’s defence chiefs have backed transgender people serving in the armed forces.

President Trump’s comments were opposed by Rear Admiral Alex Burton, Commander UK Maritime Forces, who tweeted: "As a Royal Navy LGBT champion and senior warfighter I am so glad we are not going this way."

He added: "We have a justifiably rigorous selection process but it doesn't include discrimination and we're a better fighting force for it."

Second Sea Lord Vice Admiral Jonathan Woodcock said on Twitter he was "proud" of the Royal Navy's transgender personnel.

"They bring diversity to our Royal Navy and I will always support their desire to serve their country," he added.

"I suspect many who doubt the abilities of our diverse service personnel might be more reluctant to serve than they are to comment."

A Ministry of Defence spokesman said it did not comment on "US military recruitment policy".

But the spokesman added: "We are clear that all LGBT+ members of our armed forces play a vital role in keeping our nation safe.

"We will continue to welcome people from a diverse range of backgrounds, including transgender personnel."

The Ministry of Defence said it was unable to confirm how many transgender people served in the UK military.