A crucial shift is now taking place in the Middle East towards the conflict in Syria. The Egyptian president Mohamed Morsi's call for Arab-Iranian-Turkish dialogue over the crisis and a safe transfer of power in Syria – which he repeated in his speech to the Non-Aligned Movement summit in Tehran – has been well received in Turkey and Iran. All these countries have a powerful interest in making such a dialogue work, which makes the chances of success far greater than at any time previously.
The context is clear enough. The Syrian rebels have made major gains. The revolution moved to a new phase after the 18 July attack in Damascus, which took the lives of several top security officials, a huge morale boost to the Free Syrian Army (FSA). It has since tried to secure a number of Syrian border crossings with Turkey and Iraq, and its fighters also established a military presence in Damascus and Aleppo, two cities which had been under the absolute control of the regime.
As for the regime, it has witnessed a collapse of morale, represented by a raft of major defections – the most important being that of the former prime minister and a number of military and security leaders. This has created considerable alarm within the Bashar al-Assad regime, provoking savage responses, as demonstrated by the unprecedented use of air power to bomb population centres. The outcome has been a startling rise in casualties and an unprecedented flow of refugees to neighbouring countries. Assad's interview this week asking for more time to defeat the rebels suggests the bloodshed will get even worse.
Iran recognises now that it is just a matter of time before the Assad regime falls, and its realisation that unlimited support for him will be a disaster has led Tehran to search for an exit from this Syrian quagmire.
Syria represented the cornerstone of the so-called "axis of resistance". The exit of Sunni Hamas from Damascus last year, following the regime's crackdown, was a huge blow to this axis, exposing a sectarian divide. Most regional parties who now support the Alawite regime in Damascus are Shia, from Tehran to the Maliki regime in Iraq and Hezbollah in Lebanon. This has alienated Iran from the Sunni majority in the region and worldwide, at a time when the US and Israel threaten a military strike against its nuclear facilities.
Hence the Egyptian initiative gave Iran an important opportunity which it seized immediately. The participation of Morsi in the non-aligned alliance in Tehran offers an important diplomatic opportunity for Iran.
This week's summit, also attended by UN secretary general Ban Ki-moon, took place against the background of international failure to reach consensus on Syria given the positions taken by Russia and China on the one hand, and because of the hesitancy of the US to allow the flow of more effective anti-aircraft weapons to the FSA, fearing that these weapons may present a future danger to Israel's security. This position has clearly signalled to Syria's neighbours the need for an acceptable outcome to the bloody conflict before it risks engulfing the entire region.
As for Turkey, it is beginning to realise that the Syrian crisis could harm its own national security, not least with the escalation of hostile Kurdish activities against Turkey in the Syrian border provinces. Not only that, but the collapse of the Assad regime would cause a huge security and economic burden if there were no agreement with Iran and the Arab states over a smooth transitional process. The common fear is that Syria could become the battleground for a regional proxy war, with various players seeking to secure their interests by supporting allied military groups in a conflict lasting years.
The Arab states, particularly Saudi Arabia and Qatar who support the Free Syrian Army, also favour a regional agreement of which Iran will be a part. Despite growing fears over Iran, the Gulf states don't wish for a confrontation with Tehran because the costs of such a conflict would be huge. The reception given by Saudi Arabia to Mahmoud Ahmadinejad in the recent Islamic solidarity conference in Mecca, and the announcement by King Abdullah of the establishment of a centre of dialogue between Islamic schools of thoughts in Riyadh, signals that the Gulf states have no desire to further strain relations with Iran.
The Egyptian initiative is important because it is the first by its newly elected civilian president, and also because it comes after Morsi was able to establish his authority internally by dismissing the previous military leadership. This gives his initiative greater weight abroad and signals a return to Egypt playing its historic leading role.
Egypt today appears well qualified to take a balanced position between all the parties: it does not carry any constraining baggage; and given that it represents the spirit of the Arab spring, it has moral authority. All this has pushed the regional parties to respond positively.
We should also not ignore the position of the Syrian people, who will have the final word on their future. They – like Turkey, the Arab League and the Egyptian president – will not accept any solution that does not guarantee the departure of the Assad regime. However, Morsi made clear that he is against any military intervention in Syria, which resonates well in Tehran.
And above all, it is imperative that Iran recognises this is the last opportunity to correct its strategic error of supporting a regime that is about to fall.
Wadah Khanfar is a former director general of the al-Jazeera television network.