Iran and Saudi Arabia's great rivalry explained
Iran and Saudi Arabia are locked in an escalating dispute over the Saudi execution of leading Shia cleric Sheikh Nimr al-Nimr.
Diplomatic ties have been broken, angry words exchanged and Iranian protesters stormed the Saudi embassy in Tehran. But the dispute between the two Middle Eastern nations has deep religious, historic and political roots.
Religious divisions are a factor, but not the only one
Iran and Saudi Arabia are on opposing sides of a more than 1,000-year old argument at the heart of Islam - between Sunnis and Shia.
After the death of the Prophet Muhammad, his followers split over who was his rightful heir.
It is important not to overstate the division. Sunnis and Shia share fundamental beliefs, and have co-existed for centuries - the animosity between Iran and Saudi Arabia is better understood in terms of a power struggle in the Middle East and beyond.
But despite this, sectarianism is an ugly reality in many of the conflicts raging today.
Iran and Saudi Arabia's status as leading exponents of Shia and Sunni Islam respectively have informed their foreign policies, with both sides forming alliances with countries who share their theologies - and backing militant groups in those that don't.
The Iranian revolution launched decades of hostility
The recent rift between Iran and Saudi Arabia can be traced to the Iranian revolution of 1979, which saw a pro-Western leader toppled and Shia religious authorities taking over.
Tehran began backing Shia militias and parties abroad, and Riyadh - concerned at the growing influence of a newly-strident Iran - strengthened links to other Sunni governments, including the formation of the Gulf Co-operation Council.
The 1980s saw tensions between Saudi and Iran escalate - Saudi Arabia backed Iraq's Saddam Hussein, and after clashes at the hajj in 1987 killed hundreds of Iranian pilgrims, Saudi Arabia suspended diplomatic ties for three years.
Another key milestone was the US-led 2003 invasion of Iraq, when the overthrow of Saddam Hussein saw a Shia-led government come to power in Riyadh's neighbour.
The Arab Spring saw Iran support its ally, Syrian President Bashar al-Assad, with the Saudis backing the opposition when popular protests turned into civil war.
In Bahrain, Saudi troops helped put down anti-government protests by the majority Shia population there.
Saudi Arabia felt threatened by last year's Iranian nuclear deal, fearing the easing of sanctions would allow Tehran to further support Shia groups in the Middle East.
If you add to this the Iranian fury over a deadly stampede during last year's Hajj pilgrimage and a more assertive Saudi foreign policy since the new king took charge, then the row over the execution of Sheikh Nimr becomes just the latest in a long-running struggle.
The pair are on opposing sides in major conflicts
Today there are two ongoing major flashpoints - Syria and Yemen.
As news emerged of the executions, a Saudi-led coalition battling Shia Houthi rebels in Yemen officially announced the end of a ceasefire that neither side had ever fully observed.
Saudi Arabia accuses Iran of backing the Shia group, and intervened to support Yemeni President Abdrabbuh Mansour Hadi.
Divisions on Syria boil down to the fact that Iran wants its ally, President Assad, to stay while Saudi Arabia says he must go. Both support rival fighters on the ground.
Painstaking efforts were taken to get the two sides to join peace talks later this month aimed at resolving a conflict that has killed more than 250,000 people, but with Riyadh-Tehran diplomatic ties severed, chances of success look ever more distant.
What happens next is unclear, but the situation is dangerous
Perhaps the only thing we can be certain about is that hostile Iranian-Saudi relations will only prolong the misery of Yemen and Syria, with a diplomatic solution unlikely and both sides keen to prevent the other gaining influence.
International reaction has been predictable, with Saudi allies such as Bahrain also taking measures to downgrade or end relations with Iran.
World powers have called for de-escalation. The US is in a delicate position, being a long-term ally of Saudi Arabia but seeing a thaw in ties with Iran in the wake of the nuclear deal.
American foreign policy is undergoing a "pivot" towards Asia; the US enjoys greater energy security following a fracking boom - how far would Washington be prepared to wade into the row?
The gloomiest prediction from commentators is that the region could be entering a version of the Thirty Years' War, which saw Catholic and Protestant states battle for supremacy in the 17th Century.
But many will be hoping those angered by Sheikh Nimr's death will take the advice of the cleric's own brother, Mohammed, who said any protests should be peaceful.