U.S. President Donald Trump said on Friday that the United States was not involved with a failed Iranian rocket launch, and he wished Tehran luck at finding out what went wrong.

"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 said on Twitter.

The rocket exploded on its launch pad at a space center in northern Iran on Thursday, an Iranian official said. A U.S. official also said Iran suffered a satellite launch failure.

>> Read more: Between 'ending Iran' and 'no more endless wars': The unraveling of Trump's incoherent Iran strategy | Opinion ■ As Trump signals talks with Rohani, Israel ratchets up tensions with Iran | Analysis

The President's tweet included a photo of what appeared to be the site, raising questions about whether he had disclosed U.S. surveillance secrets.

Speaking to reporters at the White House later on Friday, Trump defended his posting of the photo and reiterated that the United States had nothing to do with the incident.

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

Patrick Eddington, a former CIA satellite imagery analyst, said the photograph tweeted by Trump appeared to be a classified image taken by a U.S. spy satellite.

"If the president simply tweeted out an image from classified briefing that utilizes our most advanced overhead collection capabilities, it is no doubt welcome news to our adversaries," said Eddington, now a research fellow at the CATO Institute.

"While he has the authority to declassify any federal document, Twitter is not a legitimate or responsible way to do so."

A U.S. defense official told CNBC that the picture, which appeared to be a snapshot of a physical copy of the satellite image, was included in an intelligence briefing on Friday.

France makes attempts at rapprochement

On Monday, French President Emmanuel Macron said during a joint press conference with the American president at the G7 summit that Trump may meet Iranian President Hassan Rohani in the coming weeks.

Trump said it was realistic to think that a meeting could happen in the coming weeks.

"I have a good feeling. They have to be good players, if you understand what I mean. They can't do what they were saying they were going to do, because if they do that, they will be met with really very violent force. So I think they are going to be good," Trump told reporters.

>> Read more: Trump’s soft-pedal outreach to Iran is a preview of Netanyahu’s worst nightmares | Analysis

"I think he is going to want to meet and get their situation straightened out. They are hurting badly."

The United States has warned Iran against rocket launches, fearful the technology used to put satellites into orbit could enable Tehran to develop the ballistic missile capability needed to launch nuclear warheads.

Tehran denies the U.S. accusation that such activity is a cover for ballistic missile development.

