In a notable shift in Iran-Saudi relations, fostered by the crisis in Iraq, Iranian Deputy Foreign Minister Hossein Amir-Abdollahian has held discussions with Saudi officials in Riyadh.

Iranian State media frame the talks as about the Gaza War, with “the Israeli regime’s atrocities against Palestinians”, and “the opening of a new page in bilateral political relations and the expansion of ties”.

However, the catalyst for the meeting is the Islamic State-led insurgency which rapidly advanced through north and east Iraq since June, taking cities such as Mosul and Tikrit and moving within 40 miles of Baghdad.

The common threat of the jihadists pushed Saudi Arabia, which had been cautious about Iranian efforts at engagement, into discussions with Iran about how to check the offensive while dealing with Iraq’s political and military problems.

Earlier this month, an Iranian envoy went to Riyadh to discuss the replacement of Prime Minister Nuri al-Maliki, blamed for the instability and political division in the country. Days later, al-Maliki gave up his fight to retain power and was replaced by Deputy Speaker of Parliament Haider al-Abadi.

The Rouhani Government has pursued engagement with Saudi Arabia since it took office last August, hoping to turn frosty relations into support — or at least quiet acceptance — of Iran’s objectives in the region as well as the defense of its nuclear program. Back-channel communications have been carried out through former Iranian President Hashemi Rafsanjani and King Abdullah’s office.

However, initiatives for a visit by President Rouhani or Foreign Minister Mohammad Javad Zarif had been stymied both by Saudi reluctance and hardline resistance within Iran.

While Amir-Abdollahian’s was visiting Saudi Arabia, Iranian Foreign Minister Mohammad Javad Zarif scored further diplomatic success in two days of talks in Iraq with the country’s senior political and religious figures, including Foreign Minister Hoshyar Zebari, Iraqi Kurdistan leader Massoud Barzani, and Grand Ayatollah Ali Sistani.

In another breakthrough for Iran’s strategy — propelled in part by US military intervention in northern Iraq — Barzani acknowledged for the first time that the Kurds had received military assistance and weapons from Tehran.

Appearing alongside Zarif at a press conference, Barzani said Iraqi Kurdistan would not forget Tehran’s support that came at a crucial moment in the fight with the Islamic State.

The Iranian regime’s concern over the insurgency in Iraq was heightened earlier this month when the US launched air attacks in support of Kurdish forces as they tried to reclaim territory from the Islamic State. Tehran even claimed that the Islamic State’s jihadists were created by Washington before acknowledging the aerial operations while saying Iran would not cooperate with the US.