A photograph tweeted by President Trump of a failed rocket launch in Tehran was reportedly from an intelligence briefing and not meant for public view – even as Trump said he had the right to put out the photograph.

Trump appeared to taunt the Iranian regime Friday when he sent Iran his “best wishes and good luck” in figuring out what went wrong with an explosion this week at a space center.

IRAN STILL VIOLATING 2015 NUCLEAR DEAL, UN WATCHDOG FINDS

“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. I wish Iran best wishes and good luck in determining what happened at Site One.”

The U.S. claims such launches violate a U.N. Security Council resolution barring Iran from engaging in activity related to ballistic missiles capable of delivering a nuclear weapon. Iran has denied the claims.

Trump also included a photograph showing a black plume of smoke and the charred remains of a rocket. The photo appeared to be a once-classified image from intelligence agencies. Analysts told The Associated Press that the black rectangle in the upper-left-hand of the photo covered up the classification.

Analysts suggested the photo may have been taken by an American spy satellite passing over the area. A U.S. defense official told CNBC that the image was included in a Friday intelligence briefing, and experts told the outlet it was never meant for public view.

Late Friday, however, Trump told reporters that he had every right to share the photo with the public.

"We had a photo and I released it, which I have the absolute right to do," Trump said.

The tweeted photo appeared to get under the skin of the Iranians.

Iran's Information and Communications Technology Minister Mohammad Jawvad Azari Jahromi quickly responded with a tweet showing himself next to the satellite -- Nahid-1 -- that was supposed to be launched at the space center.

"Me & Nahid I right now, Good Morning Donald Trump!" he wrote in English.

CLICK HERE FOR THE FOX NEWS APP

Trump pulled the U.S. out of the Iran nuclear deal last year, while a report from the U.N. atomic watchdog published this week found that Iran continues to stockpile low-enriched uranium beyond the limits outlined in the 2015 deal.

The Associated Press contributed to this report.