Islamic State thugs can blame the destruction of a headquarters building on a social media “moron” in their ranks who posted a selfie that pinpointed the site.

Air Force Gen. Hawk Carlisle, head of Air Combat Command, said that eagle-eyed airmen with a recon and surveillance group in Hurlburt Field, Florida, spotted the telltale post, Defense Tech reported via Military.com.

“The guys that were working down out of Hurlburt, they’re combing through social media and they see some moron standing at this command.

“And in some social media, open forum, bragging about the command and control capabilities for Daesh, ISIL,” Hawk told a meeting hosted Monday by the Air Force Association in Arlington, Va.

“And these guys go: ‘We got an in.’ So they do some work, long story short, about 22 hours later through that very building, three [joint direct attack munitions] take that entire building out.”

Carlisle was more careful than the selfie simpleton and didn’t specify the location of the flattened HQ.

The general’s revelation came two days before a House Homeland Security Committee hearing on ISIS extremists’ use of social media.

The terror group has published 1,700 photos, videos and other posts, reaching up to 200,000 users on Twitter and other social media sites, experts told Congress, the Air Force Times reported.