Donald Trump tweeted a video of him posing for photos with US troops in Iraq.

President Donald Trump may have inadvertently unmasked a Navy SEAL team during his short visit to a US base in Iraq this week.

Ordinarily, the whereabouts of special operations forces are a closely held secret. In the rare instances when they are filmed while in a combat zone, their faces and other identifying features are usually blurred out.

But after his lightning trip to Al-Asad Air Base in western Iraq on Wednesday, Trump tweeted a video of him posing for photos with US troops, shaking their hands and signing mementos.

In one scene, he is giving a thumbs up alongside a group of what appear to be special operations forces.

According to the pool report of the event, held in a dining hall at the base, a man called Kyu Lee told Trump he was the chaplain for SEAL Team Five.

.@FLOTUS Melania and I were honored to visit our incredible troops at Al Asad Air Base in Iraq. GOD BLESS THE U.S.A.! pic.twitter.com/rDlhITDvm1 - Donald J. Trump (@realDonaldTrump) December 26, 2018

Lee recalled Trump telling him: "Hey, in that case, let's take a picture."

While the president has broad authority to declassify information, so his tweet likely didn't run afoul of any rules, some observers called it a breach of operational security.

Revealing identities "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," Malcolm Nance, a former US Navy intelligence specialist told Newsweek.

Special Operations Command (SOCOM) did not immediately respond to a request for comment.

Trump also drew criticism in the US for repeating a previously debunked claim that he had secured military members a pay raise for the first time in 10 years, when in fact the Pentagon has increased pay each year.

In Iraq following the visit, pro-Iran lawmakers called for the government to expel US forces.