In the 1980s under Bashar al-Assad’s father Hafez, Syria was the only Arab country to side with Iran during its eight-year war with Iraq. Iran returned the favour when Syria plunged into civil war, becoming an implacable ally of Bashar al-Assad, backing his fight with weapons, advisers and funding. But even with the might of Tehran behind him, Assad was ultimately unable to withstand the final rebel assault and his regime collapsed after 14 years of conflict.

The fall of Assad leaves Iran facing a whole new reality, according to Tehran-based analyst Mehdi Zakerian. He told AFP that Iran had been left isolated and would need to build an understanding with Turkey and other regional players. “This development was not a civil and internal evolution, but a change planned by external actors,” he said. “Iran must therefore make a fundamental change in its foreign and regional policy and break out of its isolation if it wishes to continue to exert influence in Syria.”

The foreign ministry’s first statement after Assad’s fall stressed the traditionally close ties between the two countries and said Tehran wanted to continue “friendly relations”. But it cautioned that future relations would depend on “the behaviour of the actors” on the ground. The sentiment was undercut by images from Damascus of the Iranian embassy being ransacked during the rebel offensive.

The president’s overthrow has taken away an essential link in the alliance of Iran-backed groups arrayed against Israel. Labelled the “axis of resistance” by Tehran, the group includes Lebanon’s Hezbollah, Palestinian militant group Hamas and Yemen’s Huthi rebels, as well as smaller groups in Iraq. Syria had long played a key role in helping Iran to supply Hezbollah with weapons. Iran’s Fars news agency acknowledged that Tehran would “inevitably face more difficulties” after the fall of Assad. But Iran’s top diplomat Abbas Araghchi said the axis would continue “even without Syria”.

Araghchi signalled a possible shift in Iran’s thinking after he met his Turkish and Russian counterparts on Saturday. He called the rebel forces opposition groups rather than terrorists, and he has also said some in the opposition are not terrorists. He said Tehran had repeatedly urged Assad to talk to those groups. “We have encouraged discussions between the government and the opposition,” he said in a live interview on state television.

After his flight to Moscow, Iranian newspapers published unflattering photographs of Assad on their front pages. Ham Mihan, a newspaper from the reformist camp, described the Assad government as an “authoritarian and repressive regime” on its front page. Other outlets trod more carefully, the Tehran Times calling it “the twilight in Syria” and the government-run Iran newspaper saying the overthrow of Assad had been “the choice of the Syrian people”.