WEEKS BEFORE Israel and Turkey finally signed a normalization agreement on June 27, representatives of Israeli security and hi-tech companies quietly visited Istanbul and Ankara in search of renewed and new contacts and contracts. The special security and intelligence ties between the two countries began in the second half of the 1950s. Encouraged by the US and UK, the intelligence communities of Israel (Mossad), Iran (Savak) and Turkey (MIT) established a tri-party consultative body code-named in Hebrew “Kalil” (Complete), also known as “Trident.” According to foreign reports, Turkey fed Israel with information it obtained about Syria, Iraq and to a certain extent Iran from its spies and listening posts built by the US. In return, according to the same foreign sources, Turkey requested and received information obtained by Israeli intelligence on Kurdish organizations, especially the PKK.Mossad officials met regularly with their MIT colleagues in either Ankara, Istanbul or Tel Aviv. During some of these sessions, senior MIT officials in charge of monitoring PKK even felt enough at ease to ask their Israeli counterparts if they would be willing to help them assassinate Kurdish terrorists. The Israelis listened politely, didn’t comment and ignored the requests.It all ended when then Turkish prime minister and now President Recep Tayyip Erdogan changed the course of Turkish foreign policy and orientation.More than six years after relations between the two countries deteriorated as a result of the tragic incidents of the Mavi Marmara, representatives of the two governments signed the agreement in a Rome hotel.The truth is that the incident shouldn’t have happened in the first place, or at least shouldn’t have resulted in the death of nine Turkish citizens and the humiliation of one of Israel’s top commando units – Flotilla 13.The Mavi Marmara was a Turkish boat that carried Turkish and international “peace” activists who wanted to break the Israeli siege and reach Gaza. The ship was purchased in 2010 by the Humanitarian Relief Foundation (IHH), a Turkish NGO active as a charity organization in more than 115 countries.But the “Intelligence and Terrorism Information Center,” an Israeli NGO with close ties to the Israeli intelligence community, claimed that IHH smuggled weapons on behalf of terrorist groups and had links to al-Qaida.In 2010, the US State Department expressed great concern over the group's links with senior Hamas officials.Following the signing of the reconciliation agreement, Erodgan slammed the IHH and said they had decided to sail without consulting with him. But when the Mavi Marmara sailed in May 2010, it seemed the IHH set off with the secret blessing of Erdogan, who was then serving as prime minister.Prior to the voyage, relations between the two countries had deteriorated and Erdogan never missed an opportunity to accuse Israel of “war crimes” against the Palestinians in general, and especially Hamas, an offshoot of the Muslim Brotherhood.Erdogan’s Islamist policy at home and abroad was to return Turkey to the glory days of the Ottoman Empire, to be the strongest power in the Middle East and position himself as modern day Sultan. He thought that Turkey no longer needed the Jewish state, and that its past relationship with Israel was a thorn in his side.To Israel, most of the Mavi Marmara passengers were terrorists – or at least agents of provocation – equipped with clubs, chains and bats, who came to cause trouble and not for a humanitarian mission.YET DUE to a flawed decision-making process, intelligence negligence, and bad military preparations, Israel fell into the trap – it tried to stop the Marmara, but ended up killing the Turkish citizens. After the incident, Turkey downgraded its diplomatic relations with Israel and stopped whatever was left of the past military and intelligence ties.The new agreement contains diplomatic economic and security-related topics. The most annoying clause for many is Israel’s consent to pay $20 million to the Turkish families of the victims.For perspective, Israel reluctantly paid relatively less to the families of crewmen of the USS Liberty ‒ an NSA spy ship that sailed near the Sinai Peninsula coastline during the 1967 war. The Israel Air Force mistook the Liberty for an enemy ship, attacked it and killed 34 crewmen.Turkey needs the agreement more ‒ much more ‒ than does Israel. Erdogan’s foreign and security policies have failed completely since the bloody civil war in Syria began more than five years ago. Though he announced that his policy would revolve around “zero problems” with his neighbors, it has been characterized by exactly the opposite. Turkey has found itself in disputes with the Bashar Assad regime in Syria, and with Russia, Iran, the Islamic State, and Kurds at home and in Syria.These disputes could have served as levers for Israel to show more perseverance, to be more stubborn and obtain a better deal. Israel could have demanded that Tukey – which sympathizes with Hamas and has a certain influence over the terrorist organization – be much more involved as a facilitator in arranging the release of two Israeli civilians and the bodies of two IDF soldiers held by Hamas. Instead, Israel agreed to an unbinding letter annexed to the agreement saying Turkey would “do its best.”Israel now finds itself in a position with which it is well acquainted and which it has been trying to avoid. Israel now will have to negotiate directly or indirectly with Hamas and pay a heavy price in return for its citizens and the bodies of its dead soldiers.Nevertheless, the new deal contains some positive elements and advantages for Israel.Turkey bent to Israeli pressure and agreed to expel from its soil an office established by Izzadin Kassam, the military wing of Hamas. From this office in Istanbul, Hamas operatives issued orders, sent money, and ran terrorist operatives in the West Bank against Israel and the Palestinian Authority.The Israel Security Agency (Shin Bet) foiled a few attempts of this type, the largest almost a year ago when dozens of Hamas members were arrested and caches of weapons found. The orders were given personally by Salah al-Aruri, the Turkey-based Hamas commander who benefited from the personal protection of Hakim Fidan, the chief of Turkey’s National Intelligence Agency MIT.To the agony of Fidan, Erdogan gave orders to expel Aruri a few months ago. Fidan didn’t like Israel, and in the last six years tried to avoid meeting with his Mossad counterparts. He very seldom met Tamir Pardo and his successor Yossi Cohen, and reduced ties between the two agencies to a minimum.FIDAN WAS suspected by Mossad of being pro-Iranian, and American intelligence sources accused him of informing Iran about an Israeli espionage ring operating on Iranian soil. Its Iranian citizens were arrested.Fidan was replaced not because of his anti-Israel approach but because he had advocated a reconciliation with the Kurdish minority, and the belligerent Erdogan didn’t like the advice of his intelligence chief.The sour relationship between the Turkish president and his security chief was one of the elements that enabled the cementing of the Turkish-Israeli deal. While Turkey has committed to preventing Hamas terrorists from operating on its soil, Israel had no choice but to silently agree to Hamas’s political wing and its members being allowed to visit, stay and open offices there.Another important success for the Israeli government is that the siege of Gaza was not lifted. Contrary to Erdogan’s claims, Turkish humanitarian aid to Gaza will be sent via the Israeli port of Ashdod. There it will be inspected to make sure that, indeed, it is only humanitarian in nature, and will then be transported via land by Israeli trucks as are all supplies to Gaza.Nevertheless, Turkish involvement in the civic and economic life of the terribly impoverished Gaza is a significant contribution toward lifting the burden from Israel and preventing a new round of war.The last war in Gaza, in Summer 2014, was partially triggered by the social and economic conditions in the Strip, probably the most densely populated area per square kilometer on Earth. With a 50 percent unemployment rate (even higher among the young generation), a severe shortage of potable water and extensive electricity blackouts (often as long as 12 hours a day), life in the 337-square-kilometer Strip is unbearable and there is constant potential for violence against Israel not only by Hamas and other militant groups but also by the general population.There are other security benefits for Israel that have been ignored or barely reported. The Turkish parliament will pass laws prohibiting suing in Turkish courts Israeli officers and officials involved in the Marmara incident ‒ in recent years, a few Turkish courts have issued warrants against senior Israeli officers. Turkey also has promised not to oppose the inclusion of Israel in NATO events and other international forums.Israeli security officials told The Jerusalem Report that they hope to renew joint bilateral or multilateral military exercises with Turkey in the future. It also is expected that Mossad and MIT will restart some kind of dialogue.But the officials admit that the “good old days” will not return. The heydays ‒ the golden era of close, even intimate military and intelligence cooperation between Israel and Turkey ‒ are over. Yossi Melman is an Israeli security commentator and co-author of ‘Spies Against Armageddon.’ He blogs at www.israelspy. com and tweets at yossi_melman.The intelligence chiefs of the three services met annually and exchanged information on common enemies – Egypt, Syria and Iraq. After Israel and Iran broke off ties, relations with Turkey continued, and reached their peaks in the 1980s and '90s, and the first decade of the 21st century.Turkey became an important market worth of billions of dollars for Israeli military and security goods as Israeli security corporations sold drones, intelligence equipment and upgraded fighter plans and tanks for the Turkish army.