Iranian security chief Saeed Jalili has told Syria's President Bashar al-Assad that Syria is part of a vital regional alliance that Tehran will not allow to be broken.
During talks in the Syrain capital, Damascus, Mr Jalili said Syria was an essential part of an "axis of resistance".
The statement came a day after Syrian prime minister Riad Hijab defected to the opposition.
Syrian TV showed Mr Assad greeting Mr Jalili, his first TV appearance in two weeks.
He had last been seen on state TV on 22 July - four days after a bomb killed four security chiefs in Damascus - leading to speculation about his health and whereabouts.
State television said Mr Assad had told Mr Jalili of "the determination of the people and government of Syria to cleanse the country from the terrorists and fight against terrorism unreservedly".
He said Syria would "continue on the path of national dialogue" and that it was "capable of thwarting the foreign conspiracies".
Mr Jalili was quoted as saying: "Iran will not allow the axis of resistance, of which it considers Syria to be an essential part, to be broken in any way."
Correspondents say "axis of resistance" refers to Iran, Syria, Hezbollah in Lebanon and the Palestinian Islamist group Hamas in Gaza.
The BBC reports that Syria is one of Iran's most important allies - a pro-Iranian foothold in the Arab Middle East and an important conduit for contacts between Tehran and Hezbollah in Lebanon, and Hamas in the Gaza Strip.
Iran also sees Turkey as a competitor for regional influence and is alarmed at renewed ties between Egypt and Saudi Arabia which constitute, at least in part, a thinly veiled alliance of "moderate Sunni Islam" against Shia Iran.
The ultimate fall of the Assad regime could leave Iran dangerously isolated.