After exactly two years of tension-easing talks that were marked by many ups and downs, the foreign ministers of Iran and Saudi Arabia met in the Chinese capital, Beijing, on Thursday.
The first meeting between the top diplomats in more than seven years came weeks after the two estranged Persian Gulf neighbours agreed to restore diplomatic ties and re-open embassies.
Relations between Iran and Saudi Arabia have traditionally been marked by tension and hostility, dating back to the 1979 Iranian revolution that overthrew the Pahlavi monarchy.
Following the revolution, when neighbours Iran and Iraq got embroiled in a protracted eight-year war, Saudi Arabia was seen quietly backing the Saddam Hussein government in Baghdad.
Relations between the two regional powers improved markedly under Akbar Hashemi Rafsanjani (1989-1997) and Mohammad Khatami (1997-2005), the two reformist Iranian presidents who reached out to Riyadh to rejuvenate bilateral ties.
However, when Mahmoud Ahmadinejad assumed power in 2005, tensions escalated again.
Following the Arab Spring in 2011, tensions boiled again between the two sides, especially in Bahrain where Tehran supported anti-government protesters and Riyadh backed the Al-Khalifa government.
After Hassan Rouhani's election in 2013, Iran again extended an olive branch to Saudi Arabia, but the efforts fell off as the two countries sparred over regional conflicts, particularly in Yemen and Syria.
READ: Saudi, Iran FMs meet for first time in 7 years
Following the hajj (pilgrimage) stampede in September 2015, when hundreds of Iranians were killed, Iran accused Saudi authorities of mismanagement while Riyadh, in turn, blamed Tehran for politicising the tragedy.
Four months later, after a prominent Saudi Shia cleric was executed, an angry mob stormed the Saudi Embassy in Tehran that prompted Riyadh to sever its diplomatic ties with Iran. Many other Arab countries, including Bahrain, UAE, Jordan and Kuwait followed suit.
Since April 2021, the two countries were engaged in marathon talks, facilitated by Iraq and Oman, to restore diplomatic ties. The breakthrough finally came last month, in Beijing.
Timeline of Iran-Saudi relations since 1979 revolution
Pre-1979: Iran and Saudi Arabia, the founder members of OPEC, an organisation of the leading oil-producing countries, shared shaky relations during the Pahlavi rule in Iran. The ties appeared to be warming toward the end of the 38-year reign of Mohammad Reza Pahlavi in February 1979.
1979: The events that led to the overthrow of the Pahlavi monarchy and the establishment of the theocratic government by Ayatollah Khomeini were largely seen with scepticism in Saudi Arabia.
1980-1988: The eight-year war between Iran and Iraq, which broke out immediately after the Iranian revolution, ignited tensions between Tehran and Riyadh, as Iran saw Saudi Arabia backing Iraqi Premier Saddam Hussein, even though their official stance remained neutral.
1984: In May 1984, Iran targeted a Saudi super tanker in regional waters after Iraq launched air raids on Iranian vessels. Saudi Arabia, in turn, shot down an Iranian F-4 Phantom jet over its waters in July of that year, killing two Iranian air force officers.
1987-1988: Relations between the two countries came to a head in July 1987 after 402 hajj pilgrims, 275 of them Iranians, died during clashes in the city of Mecca. Angry protesters in Tehran stormed the Saudi Embassy in Tehran, and Saudi's King Fahd severed diplomatic ties with Iran.
READ: Iran supreme leader: Israel wont survive another 25 years
1990: Saudi Arabia sent shipments of aid to Iran following a devastating 7.7 magnitude earthquake that jolted northern Iran on 21 June, 1990, killing almost 50,000 people.
1991: Iran and Saudi Arabia restored their diplomatic ties after a rupture in 1987.
1997: Saudi Crown Prince, Abdullah, visited Tehran for an Islamic summit in December 1997, becoming the first high-ranking Saudi government official to visit the Islamic Republic since 1979.
2001: Saudi Arabia's King Fahd congratulated Iran's Mohammad Khatami on his re-election as the President in June 2001, calling it an endorsement of the country's reformist policy. Relations warmed substantially between the two countries during Khatami's two terms in power.
2003: US invasion of Iraq that toppled the government of Saddam Hussein allowed the country's Shia majority to reclaim the political ground, which contributed to tension between Tehran and Riyadh.
2003-2010: Tensions aggravated during Mahmoud Ahmadinejad's presidency as Riyadh's suspicion regarding Iran's regional activities as well as the nuclear energy program grew. A Wikileaks cable in 2008 showed King Abdullah telling his diplomats that he wants the US "to cut the head of the snake".
2011: Arab Spring led to dramatic developments in many Persian Gulf countries. In Shia-majority Bahrain, Saudi Arabia and Iran were seen on opposite sides of the political spectrum. Tehran backed the anti-government protesters, while Riyadh strongly backed the Al-Khalifa government. Saudi Arabia sent troops to quell the anti-government uprising while accusing Iran of backing rebels.
In Syria, the two countries again squared off, with Iran backing Bashar Al-Assad and Saudi Arabia supporting rebel groups. Riyadh later joined the US-backed coalition to fight the ISIS terror group.
October 2011: the US accused Iran of plotting to assassinate the Saudi envoy to Washington. Riyadh called the evidence overwhelming, but Tehran said the report was fabricated to damage their ties.
2013: Tensions eased in the wake of the landmark interim nuclear agreement between Iran and the world's six major powers in November 2013 to limit Iran's nuclear activities. In December, Saudi-led Gulf Cooperation Council called for good ties with Iran based on "non-interference in internal affairs".
The stampede during the hajj pilgrimage in September 2015 further aggravated tensions between them. More than 400 Iranian pilgrims died in the tragedy with Iran blaming the Saudi government for mismanagement.
READ: Iran president accepts Saudi kings invitation to visit kingdom
2016: Saudi Arabia executed nearly 50 dissidents, including prominent Shia cleric, Sheikh Nimr Al-Nimr, on 2 January, 2016, which triggered angry protests in Iran. Mobs attacked Saudi diplomatic missions in Tehran and Mashhad, following which Riyadh decided to sever its ties with Tehran.
On 7 January, amid heightened tensions, Iran accused Saudi Arabia of launching air strikes on its embassy in Yemen, but Riyadh rejected the claim.
May 29, 2016: Iran announced a ban on its pilgrims going to Saudi Arabia for the annual Hajj pilgrimage, accusing Saudi authorities of "sabotage" and failure to guarantee the safety of pilgrims.
2017: In May 2017, Saudi Crown Prince, Mohammad bin Salman, in a televised interview said there is no space for dialogue with Iran, accusing it of ambitions to "control the Islamic world". His comments drew strong reactions from Iranian officials. The same day, Iran's Foreign Minister, Javad Zarif, struck a conciliatory tone, saying many regional countries came forward to mediate between Iran and Saudi Arabia and Tehran was open to dialogue.
In June 2017, a group of terrorists attacked the Iranian Parliament and the mausoleum of the country's founder Ayatollah Khomeini, killing at least 12 people. Daesh claimed responsibility, but Iranian officials pointed the finger of blame at Riyadh for being "actively engaged" in supporting militants inside Iran.
In August 2017, Iran sent a batch of pilgrims to Saudi Arabia for hajj, the first time in two years.
In November 2017, Saudi Arabia claimed to intercept a ballistic missile over Riyadh International Airport, saying it was an Iranian missile fired by Houthis from Yemen. Iran rejected the claim.
In December 2017, Lebanese Prime Minister, Saad Hariri, announced his resignation from Riyadh, citing Iran's "grip" on the country through Hezbollah. He later withdrew his resignation.
2018: Saudi Crown Prince, on March 29, 2018, called for more political and economic pressure on Iran "to avoid military conflict" in the region. Iran's Defence Minister, Amir Hatami, in response, said the Saudi Prince had fallen into "an illusion of power".
In April 2018, the Saudi Crown Prince, during his visit to France, accused Iran of "supporting terrorism" in the region. In response, Iran's Foreign Ministry spokesman dubbed Riyadh as "an epitome of terrorism".
In August 2018, Saudi Arabia allowed Iran to send a representative and establish an office that represents Iranian interests in the Arab country. The office was set up in the Swiss Embassy.
2019: Saudi Arabia accused Iran of attacks on its oil installations that brought to a standstill almost half of the country's oil supply. Iran denied involvement but Yemen's Houthis claimed responsibility.
In July 2019, Iran's Foreign Minister, Javad Zarif, said Tehran is prepared for bilateral talks with Riyadh if they are ready for it, asserting that Tehran has "never closed the door to dialogue with neighbours".
In October 2019, Saudi Arabia asked Iraqi Premier, Adel Abdul Mahdi, to mediate a meeting between the representatives of Iran and Saudi Arabia in Baghdad.
2020: In June 2020, Saudi Arabia's Foreign Minister, Prince Faisal, called on the international community to extend the arms embargo on Iran, describing Iran as a "grave danger". In September of that year, the Saudi Crown Prince condemned Iran for spreading "chaos and extremism" in the region.
2021: In April 2021, Iran and Saudi Arabia held their first round of tension-easing talks mediated by Baghdad. Four rounds of negotiations were held between April 2021 and September 2022, before the process came to a halt owing to the political crisis in Iraq.
In August 2021, foreign ministers of Iran and Saudi Arabia briefly met on the sidelines of the Baghdad summit. A month later, the Saudi Crown Prince, in his address to the United Nations, expressed hope that talks with Iran would bring "tangible outcome to build trust".
2022: Before the fourth round of talks in May 2022, the process was briefly interrupted after reports emerged about mass executions in Saudi Arabia, including that of 41 Shias. Iran abruptly pulled out without providing a reason. The process resumed a month later.
In October 2022, the Iranian Supreme Leader's top advisor, Ali Akbar Velayati, called for the re-opening of embassies and restoration of diplomatic ties between the two countries.
READ: Saudi, Iran, Syria envoys meet in Oman
In November 2022, amid the countrywide protests in Iran, Iranian Intelligence Minister, Esmail Khatib, warned Saudi Arabia against meddling in the country's internal affairs. Many Iranian officials, including IRGC Chief, Gen. Hossein Salami, accused Saudi-linked Iran International of "stoking unrest".
In December 2022, Chinese President, Xi Jinping, visited Saudi Arabia and held extensive talks with top Saudi authorities, including Crown Prince, Mohammad bin Salman. The visit, however, was overshadowed by a joint statement between China and GCC (Gulf Cooperation Council) that raised eyebrows in Tehran.
2023: Iran's President, Ebrahim Raisi, visited Beijing, the first state visit to China by an Iranian President in two decades. During the visit, he accepted an offer of mediation between Tehran and Riyadh from his Chinese counterpart, Xi Jinping.
On March 11, 2023, top security officials of the two countries met in Beijing and signed an agreement to restore diplomatic ties and re-open embassies, ending the seven-year freeze.
On April 6, 2023, top diplomats of Iran and Saudi Arabia held a meeting in Beijing, the first such contact between the two foreign ministers in over seven years. They agreed to re-open embassies within two months and reaffirm their commitment to regional security and stability.
The views expressed in this article belong to the author and do not necessarily reflect the editorial policy of Middle East Monitor.