Shortly after his first visit to US troops stationed in a war zone, President Trump posted a video on Twitter that showed him posing for pictures with service members who appear to be from SEAL Team Five in Iraq — without shielding their faces, a report said.

Trump, who had taken criticism for not visiting US forces in hot zones, traveled with the first lady to the al-Asad Airbase near Baghdad, where he mingled with troops, signed MAGA hats and defended his decision to pull out of Syria.

But during the trip, which had been shrouded in secrecy earlier Wednesday, the president apparently accidentally revealed classified information by showing the special-ops forces, Newsweek reported.

According to a pool report, details of Trump’s visit were embargoed until he finished addressing a group of 100 mostly elite members of the highly secretive unit engaged in combat operations in Iraq and Syria.

At one point, Trump paused to take a selfie with US Navy Lt. Cmdr. Kyu Lee, who said he was the chaplain for SEAL Team Five, which is based in Coronado, California, according to the mag.

The chaplain said the president told him: “Hey, in that case, let’s take a picture.”

After Air Force One left the country’s airspace, Trump posted a video in which Lee Greenwood’s “God Bless America” is heard as he and Melania Trump posed for pictures with the special warfare operators clad in full battle gear and night-vision goggles.

Malcolm Nance, a former US Navy intelligence specialist, told Newsweek that posting the video ran against traditional procedures that are meant to protect the identities of US special operations forces in a combat zone.

“Operational security is the most important aspect of personnel deployments. The real names, faces, and identities, of personnel involved in special operations or activities, are usually a closely held secret in a combat zone,” Nance said.

“Revealing them casually, through an unusual media exposure even if it’s the commander-in-chief, would prove a propaganda boom if any of this personnel are detained by a hostile government or captured by a terrorist group. There would be no denying who you are and what you do.”

Contacted by Newsweek, the Pentagon referred questions to the White House, whose reps did not immediately respond to a request for comment from The Post.

The Naval Special Warfare Command also did not return a request for comment from Newsweek.