JTA – After years of false starts, Israeli negotiators went to Geneva last week for talks aimed at ending a long-running conflict with a regional adversary.

It’s not the Palestinians. It’s Turkey.

Once a key partner of Israel, Turkey in recent years has been a thorn in its side. It supports Israel’s foes, and Turkish President Recep Tayyip Erdogan often uses international forums as opportunities to slam the Jewish state – particularly its treatment of Palestinians.

But in December, Israel and Turkey began negotiating a full restoration of ties after nearly six years of downgraded relations. Here’s what happened between the former allies, why things are improving now – and why some Israeli analysts are still skeptical the Turkey-Israel impasse will be resolved.

Turkey used to be Israel’s closest ally in the Middle East

Turkey recognized Israel shortly after its founding in 1948, and over the course of the 1990s the countries built strong defense ties. Both relatively secular, pro-Western democracies and minorities in an Arab-dominated Middle East, the two countries established regular dialogue between their defense ministries, conducted joint military training exercises and signed weapons deals. Israel sent assistance to Turkey after a massive earthquake in 1999.

Things deteriorated after Erdogan’s election and a crisis followed Israel’s killing of nine Turks trying to break the Gaza blockade.

Turkish President Recep Tayyip Erdogan delivers a speech during Presidential Culture and Arts Grand Awards ceremony at the presidential palace in Ankara, on December 9, 2015. (AFP / ADEM ALTAN)

Turkish President Recep Tayyip Erdogan delivers a speech during Presidential Culture and Arts Grand Awards ceremony at the presidential palace in Ankara, on December 9, 2015. (AFP / ADEM ALTAN)

Relations started souring in 2002, when Erdogan’s Islamic AKP party won national elections and aligned the foreign policy of Turkey in favor of the Palestinians while cooling ties with Israel. Diplomatic relations broke down completely after the May 2010 flotilla incident, when the Mavi Marmara ship manned by Turkish activists tried to break Israel’s blockade of Gaza. Israeli forces landed on the ship and killed nine activists in the ensuing melee.

Turkey demanded Israel apologize for the incident, but Israel declined. Turkey expelled the Israeli ambassador, withdrew its envoy to Israel, suspended military cooperation with Israel and excluded Israel from NATO exercises.

Now Turkey needs a friend in a disintegrating region

Turkish President Recep Tayyip Erdogan (left) meets with a delegation of the Conference of Presidents of Major American Jewish Organizations, led by Stephen M. Greenberg (right) and Malcolm Hoenlein (center), in Ankara, February 9, 2016. (Courtesy)

Turkish President Recep Tayyip Erdogan (left) meets with a delegation of the Conference of Presidents of Major American Jewish Organizations, led by Stephen M. Greenberg (right) and Malcolm Hoenlein (center), in Ankara, February 9, 2016. (Courtesy)

Netanyahu apologized to Erdogan in a 2013 phone call brokered by President Barack Obama, who was wrapping up a visit to Israel at the time. In December 2015, the sides entered talks aimed at restoring full diplomatic relations, and last week a delegation from the Conference of Presidents of Major American Jewish Organizations met with Erdogan.

The negotiations followed a bad year for Turkey. Syria’s civil war has thrown the country into crisis, exacerbating its conflict with Kurds at home and leading some to accuse Turkey of supporting the ISIS terror organization, which is fighting Kurdish forces in Iraq. Turkey also has taken in some 2 million Syrian refugees fleeing the war in Syria.

Turkey is also facing tensions with Egypt over Turkish support for Hamas and the Muslim Brotherhood, now outlawed in Egypt, and tensions with Russia following Turkey’s downing of a Russian plane in November. Restoring ties with Israel could give Erdogan a rare regional win.

“The regional challenges Turkey has with Russia, from Egypt, with the Kurds,” said Alon Liel, Israel’s charge d’affaires in Turkey in the 1980s, is giving Turkey “second thoughts about the Israel issue.”

Israel wants someone to buy its natural gas

Israel wouldn’t mind strengthening ties with one of its few Middle Eastern trading partners. Patching the Turkey relationship also would reopen the door to military exercises with NATO.

But Israel’s main motivation isn’t about war and peace, experts say; it’s economic. For months, Netanyahu has been pushing to enact a controversial program that would allow drilling in Israel’s giant offshore gas fields, which the prime minister says is essential for the national security of Israel. A deal with Turkey could both restore it as an ally and make it a large buyer of Israeli natural gas. That would be a boon for Netanyahu – and a potential bonanza for the gas companies.

An aerial view of the Tamar gas-processing rig 24 kilometers off the southern coastal city of Ashkelon, June 23, 2014. (Moshe Shai/Flash90)

An aerial view of the Tamar gas-processing rig 24 kilometers off the southern coastal city of Ashkelon, June 23, 2014. (Moshe Shai/Flash90)

But Gaza could be the obstacle to a renewed alliance – again

Relations between Turkey and Israel collapsed over Gaza, and Gaza could keep them apart – natural gas or not. Turkey hosts part of the leadership of Hamas, the militant group that governs Gaza, and has harshly criticized Israel for its blockade of the coastal strip.

As part of the deal, Turkey has demanded that Israel lift or ease the blockade. Israel, in turn, has demanded that Turkey expel Hamas’ leaders. Israeli Defense Minister Moshe Ya’alon, who has voiced pessimism about the deal, also demanded that Turkey convince Hamas to return the remains of two Israeli soldiers.

Speaking in Greece in January, Ya’alon also accused Turkey of buying oil from ISIS terrorists and said Ankara “enables jihadists to move backwards and forwards between Europe and Syria and Iraq and to be part of the ISIS terror infrastructure in Europe.”

Turkish Prime Minister Recep Tayyip Erdogan, right, seen during a meeting with Khaled Mashaal, the Hamas chief in exile, center, and Gaza’s prime minister Ismail Haniyeh in Ankara, Turkey, Tuesday, June 18, 2013. (AP/Yasin Bulbul, Prime Minister's Press Office)

Turkish Prime Minister Recep Tayyip Erdogan, right, seen during a meeting with Khaled Mashaal, the Hamas chief in exile, center, and Gaza’s prime minister Ismail Haniyeh in Ankara, Turkey, Tuesday, June 18, 2013. (AP/Yasin Bulbul, Prime Minister’s Press Office)

A Turkey detente also could backfire for Israel. In recent years, Israel has bolstered ties with Egypt led by Abdel Fatah el-Sisi, who last week met with a Presidents Conference delegation in Cairo, as well as Greece and Cyprus – all Turkish rivals. Retaining Greek and Cypriot support is especially important, Liel said, because they act as Israeli allies in the European Union.

It may not be worthwhile, he said, to risk those ties for a detente with a Turkish government that has spent the past seven years denouncing Israel.

“Erdogan is an unpredictable player,” Liel said. “There’s a concern that if they sign with him today, and there’s a war in Gaza in four to five months, he’ll make trouble.”