President Donald Trump's decision to tweet out a photo of an Iranian launch pad that he got from a classified intelligence briefing this week has astonished national-security and intelligence veterans.

One analyst said the photo was likely taken by a classified US spy satellite. The US rarely disseminates such imagery, and Trump's move to release the photo presents a goldmine for foreign intelligence services, who can use it to make inferences about the US's aerial surveillance capabilities.

Trump may have blown "the cover on a multi-decade, multi-president campaign to disrupt Iranian missile and nuclear development with minimal loss of life," wrote Alex Stamos, the Director of the Stanford Internet Observatory and adjunct professor at the Center for International Security and Cooperation.

Robert Deitz, a former top lawyer at the CIA and the National Security Agency, agreed Trump made a "serious mistake" and told Insider "the Russians and the Chinese will be very happy to study this."

Visit Business Insider's homepage for more stories.

President Donald Trump has spent a good portion of his time over the last several days ripping former FBI director James Comey and falsely accusing him of leaking classified information to the public after he was fired.

So it was ironic when Trump took to Twitter on Friday to release sensitive US military information that he received during a classified intelligence briefing earlier that day.

"The United States of America was not involved in the catastrophic accident during final launch preparations for the Safir SLV Launch at Semnan Launch Site One in Iran," Trump tweeted. "I wish Iran best wishes and good luck in determining what happened at Site One."

He was referring to a rocket launch failure on Thursday at a space center in Iran that was confirmed by both Iranian and US officials. The explosion marks Iran's third consecutive failure at lifting a satellite into orbit, and Trump's line about wishing "Iran best wishes and good luck in determining what happened" was seen by many as a taunt directed at the rogue regime.

Attached to the tweet was a photo of the launch pad where the explosion happened:

Read more: US official confirms that Trump tweeted out a picture from a classified intelligence briefing

The US 'rarely' disseminates such photos

Trump's tweet immediately set off alarm bells in the military and intelligence community because the photo was a much higher resolution and better quality than the commercial satellite images of the explosion that were publicly available.

In fact, the photo appears to contain specific markers that indicate it was taken by a US military asset and may have had a high classification level. A US official also told CNN that the photo looks like it came from a satellite operated by the intelligence community but added that the US would not send a drone or manned aircraft into Iranian airspace.

Allison Puccioni, an imagery analyst and army veteran, wrote that although the US openly acknowledges that it has the capability to collect technical information about overseas proliferation, it "rarely" disseminates such imagery, "with a noteworthy exception of such images collected during the 2002-2003 runup to the Iraq War."

"Trump's tweeted image was not from any sensor" anyone in the open-source intelligence community can access, she added. "The dissemination of this image seems out-of-step with the US policy regarding its publication of such data. Not sure what the political objective of dissemination was."

Read more: US spies say Trump's G7 performance suggests he's either a 'Russian asset' or a 'useful idiot' for Putin

Cees Bassa, a professional astronomer who works at ASTRON, the Netherlands Institute for Radio Astronomy, wrote that based on the features of the launch pad in the photo and the positioning of the camera, the image was likely captured by USA-224, one of four classified US spy satellites that are currently in orbit and are operated by the National Reconnaissance Office.

Such satellites are believed to be able to produce the sharpest images of the Earth's surface, Bassa added, and the actual resolution of the images is kept under wraps.

The images aren't often published because their dissemination can help analysts — including, and perhaps especially, those who work for hostile foreign powers — discern the resolution of the satellites and make other inferences about the US's aerial surveillance capabilities.

Trump has not said whether he discussed the national security risks of releasing the image with intelligence officials before tweeting it out. But one aide on the National Security Council told Insider they were not aware of any discussion of the matter beforehand.

A goldmine for foreign intelligence: 'The Russians and the Chinese will be very happy to study this'

Robert Deitz, a former top lawyer at the CIA and the National Security Agency, told Insider Trump made a "serious mistake."

"It identifies for the world (not just Iran) the methods we have attained" in collecting imagery intelligence, which refers to information collected through photographs and other images, he said. "One doesn't use intel for the purposes of taunting. The Russians and the Chinese will be very happy to study this."

Alex Stamos, the Director of the Stanford Internet Observatory and adjunct professor at the Center for International Security and Cooperation, echoed that view, writing, "The propensity for saying the quiet part out loud is less amusing when it blows the cover on a multi-decade, multi-president campaign to disrupt Iranian missile and nuclear development with minimal loss of life."

Read more: DOJ watchdog finds James Comey violated FBI policy by sharing memo with The New York Times

Trump's tweet comes after a week of national-security and foreign-policy blunders, and none was more prominent than his fervent defense of Russia and Russian President Vladimir Putin at last weekend's G7 summit in France.

At the meeting, Trump refused to hold Russia accountable for violating international law, consistently called for Russia's readmittance to the alliance, and blamed his predecessor for Russia's annexation of Crimea.

Several current and former spies found Trump's actions so "unfathomable" that they raised — again — the possibility that the US president is an unwitting Russian asset.

With his tweet taunting Iran, Trump invited similar blowback and allegations that he values his personal brand more than the country he represents.

"We spend some $70 billion annually on our intelligence capabilities, while countless professionals put their lives on the line," Edward Price, the former senior director of the National Security Council under Barack Obama, told Insider. "And yet, Trump seems to have put at risk a key asset for absolutely no benefit."

Read more: Russia came out the winner of this year's G7 summit despite being kicked out, and Trump looked like 'Putin's puppet'

President Donald Trump departs the White House on foreign travel to attend the G7 summit in France Reuters

'Maybe he has a right to act this way, even if it is moronic'

John Sipher, who served as a CIA clandestine services officer for 28 years, told Insider that the image Trump tweeted out could have come from the National Geospatial-Intelligence Agency (NGA), and while it's unclear how sensitive the photo was, the NGA can quickly provide images at all classification levels, including unclassified images.

In this case, Sipher said, "it's possible the intelligence representative was able to quickly determine that the image was not sensitive."

However, former officials stressed that even though, as president, Trump has the authority to declassify anything he wants, he's still expected to act with the utmost discretion.

Trump's "release of the image was consistent with his disdain for foreign policy and intelligence expertise," Sipher said. "If he sees an immediate personal or political benefit, he does not feel any need to follow rules, regulations, protocol, or even laws."

Alex Finley, another former CIA officer, agreed, telling Insider that Trump's actions were "outrageous and reckless," but that "it's hardly the first time we've seen this. And maybe he has a right to act this way, even if it is moronic."