Concern that Syria’s stockpile of chemical weapons could reach militant groups bordering Israel and Turkey was the motivation for restoring relations with Ankara after a three-year rift, Israel’s prime minister said Saturday.

Benjamin Netanyahu wrote on his Facebook page that Israel and Turkey, which border Syria, need to communicate with each other over the Syrian crisis.

“The fact that the crisis in Syria intensifies from moment to moment was the main consideration in my view,” Netanyahu wrote.

Netanyahu phoned Turkish Prime Minister Recep Tayyip Erdogan on Friday and apologized for a botched raid on a Gaza-bound flotilla in 2010 that left eight Turks and one Turkish American dead. Turkey had demanded an apology as a condition for restoring ties. Netanyahu had until now refused to apologize, saying Israeli soldiers acted in self-defense after being attacked by activists.

President Obama, on a visit to the Middle East last week, helped broker the Israeli apology to Turkey.

Turkey and Israel were once strong allies, but relations began to decline after Erdogan, whose party has roots in Turkey’s Islamist movement, was elected in 2003. Erdogan has embarked on a campaign to make Turkey a regional powerhouse and the leading voice in the Muslim world, distanced from Israel.

After the flotilla raid, the nations withdrew their ambassadors.

Spillover from fighting in Syria’s civil war reaches Israeli communities in the Golan Heights from time to time. Errant mortar shells and machine-gun fire have caused damage, sparked fires and spread panic, but there have been no reported injuries.

Israel is concerned that Syria’s chemical arsenal could fall into the hands of militants such as Lebanon’s Hezbollah, an Assad ally, or an al-Qaeda-linked group fighting with the rebels.

Netanyahu’s national security adviser, Yaakov Amidror, said the timing was right for reconciling with Turkey. “Between us and Turkey is a country that is falling apart and that has chemical weapons,” he said.

Last week, Syrian rebels and President Bashar al-Assad’s government blamed each other for a chemical attack on a village. The United States said there was no evidence chemical weapons were used. The two-year-old conflict has killed an estimated 70,000 people.