President Donald Trump on Wednesday said that transgender troops will not be allowed to serve in the U.S. military.

“After consultation with my Generals and military experts, 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,” Trump wrote in a series 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. Thank you.”

The Department of Defense under President Barack Obama reversed the Pentagon's previous policy barring transgender troops. The policy was still under review. Last month, Defense Secretary James Mattis delayed implementation of a plan to allow transgender individuals to enlist in the military.

The Human Rights Campaign (HRC) and the American Civil Liberties Union (ACLU) were among the groups criticizing the policy change.

“Today Donald Trump has proven himself as unpatriotic as he is unfit to serve as Commander in Chief. He has put a target on the backs of the more than 15,000 transgender troops proudly serving in our military,” said HRC President Chad Griffin. “This heinous and disgusting action endangers the lives of American service members, undermines military readiness and makes our country less safe. It is also the latest effort by Trump and Mike Pence to undo our progress and drag LGBTQ people back into the closet by using our lives as political pawns.”

“This is not about cost. This is not about readiness or a strong military,” the ACLU said in a statement. “Today’s announcement is about targeting, demonizing, and endangering a group of people who are risking their lives every day for our country.”

Earlier this month, Congress rejected an amendment that sought to ban transition-related health coverage for transgender servicemembers.