Revolutions are unpredictable, but so are post-revolution periods – something that will be evident if and when the Bashar al-Assad regime falls in Syria.

It is, of course, possible that when the regime falls, the fighting will end and a single body will manage the country’s affairs until elections take place. But it’s also possible that there will be chaos or even civil war. If this happens, expect fighting between the minority ruling Alawites and the majority Sunni population to ensue.

Should there be a smooth transition to democracy, Iranian Supreme Leader Ali Khamenei is likely to try to establish relations with the new Syrian government – indeed he may even try to do so before Assad falls, in order to protect Iran’s interests in Syria. And Khamenei may succeed, depending on whether the new authorities in Damascus are interested in relations with Tehran.

But what if there is instead a civil war? After all, as prominent Middle East analyst Vali Nasr noted in a recent op-ed for the New York Times, in the Arab world, ‘when dictatorships crack, budding democracies are more than likely to be greeted by violence and paralysis.’

Clearly, chaos in Syria could have region-wide implications, and Iranian government officials have already started to warn the international community about the possibility of such a scenario unfolding. It’s unclear how Iran would respond if this does transpire, but one thing seems certain – Iran is extremely unlikely to play the part of spectator. In fact, the opposite may very well end up being true, with Iran likely to back the Alawites by providing them with material and economic support.

The Alawites are a subset of the Shiite sect of Islam, and Iran, the biggest Shiite country in the world, whose supreme leader sees himself as God’s representative to all Shiites, would support them. But religious proximity isn’t the only reason Iran would support the Alawites. To Iran’s leaders, alliances are there to serve the regime’s interests, meaning that if supporting fellow Shiites serves Iran’s interests then Tehran will do so. But by the same token, if assisting Shiites undermines the regime's interests, Tehran isn’t afraid to steer clear – one only has to look at the relative indifference Iran shows to the many hundreds of Shiites killed each year in Pakistan by Sunni extremists simply because it isn’t in Iran’s interests to fall out with the Pakistani government.

So if not just for religious reasons, why would Tehran back the Alawites in the chaos of a civil war? Because it would help Tehran undermine Israel’s security and Saudi Arabia's interests.

Civil war in Syria would be a nightmare for Israel, worse even than the Muslim Brotherhood taking over in Damascus. After all, should the Brotherhood come to power, Israel would at least have someone to hold to account for attacks launched from Syrian territory. But the anarchy of civil war would leave Israel with no one to turn to, and no single authority to threaten reprisals against. If this happens, expect Iran to encourage its allies to attack Israel in an attempt to undermine its security further.

But a civil war could be welcomed in Tehran for another reason – because it would also undermine Saudi interests. Saudi Arabia and Iran have for years been engaged in their own Cold War, especially since Iran’s Islamic Revolution in 1979. They’ve competed for power and influence in Iraq, Lebanon, Yemen and Bahrain – and now Syria. According to David Ignatius, writing in the Washington Post, the Saudis have been ‘pumping money to Sunni fighters in Syria.’ Meanwhile, Iran has been backing the Alawite dominated government of Assad. In the case of civil war in Syria, Iran would use the opportunity to undermine Sunni groups as a means of limiting Saudi influence in Syria. Iran has already lost Bahrain to the Saudis – it’s determined not to lose Syria as well.

Fighting a proxy war in Syria on behalf of the Alawites wouldn’t be without risks for Iran. For a start, it could place Iran’s relations with Hamas under severe strain as an overwhelming majority of Palestinians in Syria, as well as the Hamas movement itself, are Sunni.

But it could also impact Iran’s relationship with Hizbollah as Iran would most probably require their assistance in backing the Alawites in the event of civil war. Securing Hizbollah’s backing could affect that group’s standing in the Islamic world, as its popularity in the region has until now come from its portrayal of itself as an Islamic resistance force. Helping to put down Sunnis in Syria would risk undermining this image.

And of course fighting a proxy war in Syria could also impact Iran’s relationship with Turkey, itself a Sunni country whose priority is stability in Syria.

Still, such costs are unlikely to dissuade Iran from taking part, should the opportunity present itself. In Tehran’s cost/benefit analysis, the chance to undermine Israel and Saudi Arabia in one go is likely to outweigh the potential dangers. With Syrian demonstrators burning Iranians flags, Tehran may find that a rapprochement with the Sunni opposition may prove to be too cumbersome, or even impossible. A civil war might suit it better, as would the ensuing grief for Israel and Saudi Arabia.