KHARTOUM, Sudan — Sudan’s news agency says two Iranian naval ships have departed after docking at a Sudanese port for three days.

Sudan denied that the visit had anything to do with an explosion at a Khartoum weapons factory last week. Khartoum has charged that Israel hit the factory with an airstrike.

Israel has not commented, but there is speculation that Sudan facilitates the transfer of Iranian weapons to radical, violent groups like Hamas in Gaza and Hezbollah in Lebanon.

The Sudan News Agency quoted army spokesman Col. Sawarmy Khalid as saying Wednesday that the two vessels, a helicopter carrier and a destroyer, “have returned to where they came from.”

He said the two Iranian warships sailed from the Indian Ocean, where they were posted to carry out anti-piracy patrols.

The helicopter carrier Khark and the corvette destroyer Shahid Naqdi arrived at the Red Sea port on Monday, semi-official Iranian news agencies reported.

According to the Iranian Navy, the ships were dispatched to the Red Sea to convey “the message of peace and friendship to the neighboring countries and ensuring security for transportation and shipping against sea piracy.”