President Trump said Thursday he is “doing the military a great favor” by banning transgender people from serving in the armed forces.

“I have great respect for the community," Trump said from his golf club in Bedminster, N.J. "I think I’ve had great support, or I’ve had great support from that community. I got a lot of votes. It’s been a very complicated issue for the military, it’s been a very confusing issue for the military, and I think I’m doing the military a great favor.”

Trump announced the sudden shift in military policy last month in a series of tweets.

ADVERTISEMENT

"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 tweeted at the time.

"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"

After consultation with my Generals and military experts, please be advised that the United States Government will not accept or allow...... — Donald J. Trump (@realDonaldTrump) July 26, 2017

....Transgender individuals to serve in any capacity in the U.S. Military. Our military must be focused on decisive and overwhelming..... — Donald J. Trump (@realDonaldTrump) July 26, 2017

....victory and cannot be burdened with the tremendous medical costs and disruption that transgender in the military would entail. Thank you — Donald J. Trump (@realDonaldTrump) July 26, 2017

The announcement sparked immediate criticism, including from top Republican senators and dozens of retired generals and admirals.

Two LGBTQ rights groups announced Wednesday that they would sue Trump over the ban, claiming claim the president's July tweets announcing plans to reverse the Department of Defense’s policy on transgender service members violates the equal protection component of the due process clauses of the Fifth Amendment.