The agreement further strengthens ties between Iran and Syria, both hostile to Israel, as Tehran seeks to bolster its position as a regional powerhouse amid political upheaval in many Middle Eastern states.
"The two parties will cooperate with each other in training issues and the exchange of personnel," IRNA quoted the agreement, signed by the commanders of both navies, as saying.
Syrian officials do not comment on security matters.
The two Iranian ships arrived in Syria on Wednesday after passing through the Suez Canal into the Mediterranean, the first Iranian navy vessels to do so since Iran's 1979 Islamic Revolution.
Egypt's decision to allow the ships through its canal was made under an interim government after the fall of President Hosni Mubarak. Iran is hoping to restore ties, cut for decades, with Cairo, an US ally which has a peace treaty with Israel.
Iran has welcomed the fall of US ally Mubarak as a sign the Washington's influence in the Middle East is on the wane.
'Message of peace'
The United States has led international moves to tighten sanctions over Iran's nuclear program which it fears could be aimed at making atomic weapons, something Tehran denies.
"The message of the ships is to announce the peace and friendship to Islamic countries and the region and attempt to strengthen relations between the countries," Iranian navy commander Rear Admiral Habibollah Sayyari was quoted as saying by the semi-official Fars news agency.
Defense Minister Ehud Barak has said the move was a provocation but not a threat.
"If they were bringing rockets or weapons or explosives to Hamas or Hezbollah, we would have probably acted against them," he told CNN on Thursday.
Iran ambassador to Syria, Ahmad Mousavi, said Iran was strengthening its geopolitical status but had no desire for war.
"Iran's position in the world, considering developments in the region, is very powerful; it does not seek to wage war against anyone," he was quoted as saying by IRNA.
- Follow Ynetnews on Facebook