President Donald Trump said Thursday that he did U.S. military leaders a big favor by banning transgender troops from serving their country ― even though he never consulted the Pentagon on his plans and has left thousands of transgender service members in limbo.

“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 told reporters at his golf club in New Jersey, where he’s vacationing this month.

But the president didn’t tell military leaders he was planning to make such a major policy change. The Pentagon was blindsided by Trump’s announcement last month, which he made on Twitter, and has since been referring questions to the White House. If anything, this was precisely what military leaders did not want to do, since they lifted the ban last year after an exhaustive review of military readiness policies.

“Our mission is to defend this country, and we don’t want barriers unrelated to a person’s qualification to serve preventing us from recruiting or retaining the soldier, sailor, airman or Marine who can best accomplish the mission,” then-Defense Secretary Ashton Carter said. “We have to have access to 100 percent of America’s population for our all-volunteer force to be able to recruit from among them the most highly qualified — and to retain them.”

Trump’s snap decision to change the policy made more sense in light of a Politico report that he did so to appease conservatives in the House so they would pass a spending bill that included money to build his border wall.

Trump went way further than what they wanted: House Republicans wanted him to announce that he opposed federal money going toward gender reassignment surgery for transgender troops, but the president instead said they would be prohibited from serving at all. Oops.

Fifty-six retired generals and admirals have since warned Trump that banning transgender troops would degrade military readiness.

It would cost about $960 million to discharge the transgender troops currently serving, according to the Palm Center, an independent research institute. There are between 1,320 and 6,630 transgender people in active military service, a Rand Corp. study estimates.

On Thursday, the president went on to say that he has “great respect” for the LGBTQ community, and that he’s had “great support” from them, too.

“I got a lot of votes,” he said.

Seventy-eight percent of LGBT people voted for Democratic presidential nominee Hillary Clinton in November. Trump only got 14 percent of their vote.

There were like four lesbians who voted for him.