Iran's foreign ministry has said that an Iranian vessel, the Saviz, had been targeted in the Red Sea.
The confirmation comes a day after media reports that the ship had been attacked with limpet mines.
"The explosion occurred on Tuesday morning near the Djibouti coast and caused minor damage with no casualties.
"The vessel was a civilian ship stationed there to secure the region against pirates," Foreign Ministry spokesman Saeed Khatibzadeh said.
"The issue is under investigation".
It was the latest in a reported series of attacks on Israeli and Iranian-owned cargo ships since late February in which the two arch-enemies accused each other of responsibility.
The New York Times cited a US official as saying Israel had informed Washington it had struck the vessel in "retaliation for earlier Iranian strikes on Israeli vessels".
Israeli officials declined to comment on the attack on the Iranian ship.
There have been three other reported attacks on Iranian or Israeli-owned shipping since 25 February.
On 25 March, a cargo ship owned by an Israeli company was damaged by a missile in the Arabian Sea in what was suspected to be an Iranian attack, according to a senior Israeli security official.
The ship was able to continue its journey, he said.
Two weeks before, Iranian state media quoted an Iranian investigator as saying Israel was highly likely to have been behind an explosion that caused a small fire on an Iranian container ship in the Mediterranean.
Israeli Defence Minister Benny Gantz declined to comment directly at the time but said Iran regularly sent weapons to its proxies in the region.
On 25 February, Israeli Prime Minister Benjamin Netanyahu blamed Iran for an explosion aboard an Israeli-owned vehicle-carrier ship in the Gulf of Oman.
A US official said the blast ripped holes in both sides of its hull and an Israeli official said limpet mines were used. Iran denied responsibility.
The incidents have occurred since US President Joe Biden took office in January with a commitment to rejoin world powers' 2015 nuclear deal with Iran if Tehran returns to full compliance with the deal.
The agreement was abandoned by Mr Biden's predecessor Donald Trump in a move welcomed by Israel.
Iran and the US began indirect talks in Vienna yesterday that included the other powers on ways to revive the deal.
Both Iran and the US called the talks "constructive".