President Donald Trump issued a ruling on Wednesday outlawing military service by people who do not conform to a binary gender system.

“Please be advised that the United States Government will not accept or allow transgender individuals to serve in any capacity in the U.S. Military,” he wrote in a string of tweets. “Our military must be focused on decisive and overwhelming victory and cannot be burdened with the tremendous medical costs and disruption that transgender in the military would entail.”

Trump previously promised to be an advocate for transgender people, writing during the campaign, “Thank you to the LGBT community! I will fight for you while Hillary brings in more people that will threaten your freedoms and beliefs.”

Rather today Trump imposed a rigid standard, preventing service “in any capacity,” even roles that might avoid contentious issues like restrooms and living quarters.

His only clear justification was the inability to deal with “tremendous medical costs.”

The military has not historically covered gender-transition surgeries, though President Barack Obama did announce plans for it to begin doing so. That cost would be between $2.4 million and $8.4 million annually for transition-related costs, according to a RAND analysis commissioned by the Department of Defense. The group estimated there are between 1,320 and 6,630 active-duty transgender servicepeople currently. A study in The New England Journal of Medicine in 2015 put the number at 12,800 people and $4.2 million to $5.6 million, concluding that “doctors agree that such care is medically necessary.”