The vessels docked in the Port of Sudan on the Red Sea on Monday, days after Sudan accused Israel of an air raid on the Yarmouk arms factory in the south of Khartoum, which killed at least two people.
The warships were opened for public access for a day during the visit, the ministry said.
Sudanese Foreign Minister Ali Karti earlier denied any link between the visit of the Iranian task force and the alleged Israeli attack on the Yarmouk plant last week, saying it was a routine friendly visit in line with international regulations.
Sudan has also denied unconfirmed media reports suggesting that the plant produced weapons for Iran, Syria, and radical Islamist groups Hamas, Hezbollah and Islamic Jihad.
Israel, which suspects Sudan of smuggling weapons to the Hamas-controlled Gaza Strip via Egypt, has refused to comment on Khartoum's allegations about the factory blast.
Khartoum: Two Iranian warships on Wednesday left Sudan after their three-day visit "in support of political and diplomatic ties between the two countries", the Sudanese Defence Ministry said.
First Published: Thursday, November 01, 2012, 11:43