In a surprise announcement (even to some US defense officials) Wednesday morning, President Donald Trump tweeted that the military would no longer "allow or accept" transgender Americans, saying their service would cause "tremendous medical costs and disruption."

Sixteen countries, including the Czech Republic, Norway, and Israel, allow transgender service in the military. (Spain's and Thailand's forces also accept trans people, but only in administrative positions.)

The Canadian military took the opportunity to troll the US with a tweet of its own:

Other high-ranking foreign military officials have expressed their opposition to Trump's move, as well.

Alex Burton, commander of the UK's Maritime Forces, said on Wednesday he is "so glad we are not going this way."

In an interview with Israel Army Radio, the former commander of the the Israel Defense Forces Manpower Command, Elazar Stern, said that a ban on transgender soldiers would be a waste of time.

"It makes us strong that we don't waste time on questions like this," Stern, now a member of Israel's parliament, said. "It's something to be proud of."

RELATED: Senators react to ban on transgender people in the military



10 PHOTOS Senators react to ban on transgender people in the military See Gallery Senators react to ban on transgender people in the military "We should all be guided by the principle that any American who wants to serve our country and is able to meet the standards should have the opportunity to do so — and should be treated as the patriots they are," McCain said. (Photo credit BRENDAN SMIALOWSKI/AFP/Getty Images) Democratic House Minority Leader Nancy Pelosi noted in a statement that the date of Trump's announcement coincided with the date President Harry Truman desegregated the military in 1948. "Sixty-nine years later, President Trump has chosen this day to unleash a vile and hateful agenda that will blindside thousands of patriotic Americans already serving with honor and bravery," Pelosi said. "This disgusting ban will weaken our military and the nation it defends." (Photo by Joe Raedle/Getty Images) Republican Sen. Richard Shelby of Alabama was first told of Trump's announcement during a CNN interview, responding that he wanted to read the policy's wording but was sure the Senate will hold hearings on the matter. "You ought to treat everybody fairly and you ought to give everybody a chance to serve," he said. (Photo by Zach Gibson/Bloomberg via Getty Images) Democratic Sen. Tammy Duckworth of Illinois, an Iraq War veteran who lost her legs in combat, called the ban "discriminatory and counterproductive to our national security." (Photo by Zach Gibson/Bloomberg via Getty Images) "When my Black Hawk helicopter was shot down in Iraq, I didn't care if the American troops risking their lives to help save me were gay, straight, transgender or anything else. All that mattered was they didn't leave me behind," Duckworth said in a statement. "If you are willing to risk your life for our country and you can do the job, you should be able to serve — no matter your gender identity, sexual orientation, or race." (Photo by Mark Wilson/Getty Images) (Photo by Mark Wilson/Getty Images) When Republican Sen. Orrin Hatch of Utah was asked whether he stood with the state's transgender community, Hatch responded "Yes" on Twitter, then released a longer statement saying "I don't think we should be discriminating against anyone." Democratic Sen. Sherrod Brown said in a statement the military "should not turn away anyone who is willing and able to serve this country and help keep Americans safe." (Photo By Tom Williams/CQ Roll Call) (Photo By Tom Williams/CQ Roll Call) The ban is "discrimination, plain and simple," Democratic Sen. Kamala Harris of California tweeted. Source: Twitter (Photo by Chip Somodevilla/Getty Images) Sen. Cory Booker of New Jersey wrote that Trump is "wrong" and transgender service members are "heroes like anyone else risking their lives to defend us." Source: Twitter (Photo By Bill Clark/CQ Roll Call) Up Next See Gallery Discover More Like This HIDE CAPTION SHOW CAPTION of SEE ALL BACK TO SLIDE

It is not clear if Trump's plan to reinstate the ban on transgender military service will become actual policy. US Joint Chiefs of Staff Chair Joseph Dunford wrote in a letter that there will be no change in trans policy until the military receives official counsel from the president, according to Reuters. Sources close to US Secretary of Defense Jim Mattis said he was "appalled" by Trump's tweets, the New York Times reported.

Senior officials in each branch of the military had supported barring trans soldiers leading up to Trump's announcement, the Military Times reports.

However, a number of politicians and veterans have strongly voiced opposition to the ban. Rep. Dan Kildee, a vice chair of the LGBT Equality Caucus, called the move a "slap in the face to the thousands of transgender Americans already serving in the military." Retired US Navy SEAL Kristin Beck, who is transgender, opposedTrump's statement on the cost of transgender people in military, saying "the money is negligible ... You're talking about .000001% of the military budget."

In an interview with Business Insider, she also said: "Let's meet face to face, and you tell me I'm not worthy. Transgender doesn't matter. Do your service."

More from Business Insider: