WASHINGTON (Reuters) - U.S. President Donald Trump’s sudden decision to ban transgender  personnel from serving in the military has alarmed some senior military officers who were caught off guard by it. Trump’s declaration, which came via early morning tweets on Wednesday, appeared to pre-empt an ongoing Pentagon review looking into allowing openly transgender recruits to join the military, and he drew criticism from three senior officers interviewed by Reuters on Thursday.     “I hope our commander in chief understands that we don’t transmit orders via Twitter, and that he can’t, either,” one said by telephone, speaking on the condition of anonymity. “Even if this were an order, implementing it legally would take considerable time, if it’s even possible.”      Rights groups and some lawmakers from both parties accused Trump of politically motivated discrimination and said the decision creates uncertainty for transgender active-duty service members and reservists, who say they number in the thousands.. The United States’ top military officer, Marine General Joseph Dunford, told the armed forces on Thursday there had been no change yet to Pentagon policy on transgender personnel. Dunford, chairman of the Joint Chiefs of Staff, acknowledged the uncertainty that followed Trump’s announcement in a note to service chiefs, commanders and senior enlisted leaders. “I know there are questions about yesterday’s announcement on the transgender policy by the President,” Dunford wrote. “There will be no modifications to the current policy until the President’s direction has been received by the Secretary of Defense and the Secretary has issued implementation guidance,” Dunford said in the message, first reported by Reuters. Dunford then made the assurance that the military would “treat all of our personnel with respect.”  His message neither voiced support nor opposition to Trump’s decision. One official, speaking on condition of anonymity, said Dunford in a separate message sent more narrowly to heads of the Army, Navy, Marine Corps and Air Force acknowledged that Trump’s announcement on Wednesday was “unexpected.” The Defense Department had been expected to begin formally allowing transgender people to enlist this year. But Mattis on June 30 approved a six-month delay to allow for a review.  As a presidential candidate, Trump last year had vowed to fight for lesbians, gays, bisexuals and transgender people.  His move on Wednesday was praised by conservative activists and some fellow Republicans. The White House said Trump had “extensive discussions with his national security team,” and that Defense Secretary Jim Mattis was informed after the president decided on Tuesday to go ahead. Trump cited “tremendous medical costs and disruption” as a justification for the ban, a point disputed by experts and advocates for allowing military service to be determined by an individual’s capabilities, not gender identity or sexual preference. The Army’s chief of staff, General Mark Milley, said on Thursday that there had been issues with transgender individuals serving in the Army. “I will be candid. ... This is a complex issue and there (are) a variety of challenges out there that we have to deal with and we have been working through it, but this is not clean-cut either way,” he said. White House spokeswoman Sarah Sanders said implementation of  Trump’s decision was still being worked out. Separately, the Trump administration on Thursday told a U.S. appeals court in New York that federal law does not ban discrimination against gay employees, a sharp reversal of the position Democratic former President Barack Obama took. Trump’s plan to ban transgender military service members has  unleashed legal threats from advocates who say they are seeking plaintiffs who want to sue. Trump’s tweets did not make clear when a ban would go into effect, nor whether it applies to serving members of the military or those wishing to join.  But if the Defense Department actively roots out transgender people and discharges them from the military, the Pentagon is likely to face an especially contentious fight, legal experts say. “There’s no valid justification for excluding transgender people from the military,” said Jon Davidson, legal director for LGBT rights group Lambda Legal. It was also unclear whether it might go beyond active-duty forces and apply to reservists. Indiana National Guard reservist Cameron St. Andrew, who  resigned from full-time service after the November election, told Reuters that as a transgender person he was concerned about his status. “I try to be tough about it,” he said, but added: “It breaks your spirit down.” One active-duty U.S. military officer, speaking on condition of anonymity, said senior officials were not consulted. “We’re scratching our heads and asking where the hell this came from,” the officer said by phone.  “Maybe the president is in step with some members of Congress and some voters, but he is out of step with today’s military. Our service personnel today don’t give a damn about the personal lives of their comrades so long as they know they can trust them when it counts.” 