Six years ago, nine Turks lost their lives while attempting to breach Israel’s blockade on Gaza, touching off a fury between the two nations that resulted in a full diplomatic breach. In the years that followed, more Turkish attempts to run the blockade in support of Hamas ended less violently and no more successfully, while Turkey demanded compensation for the deaths of its citizens on board the Mavi Marmara. Hamas found itself the beneficiary of this six-year rupture between key American allies.

The salad days for Khaled Mashal appear to be over. Turkey and Israel announced yesterday that they would restore full diplomatic relations. Israel agreed on compensation, and Turkey agreed to respect the Gaza blockade while being allowed to supply Gaza with humanitarian aid — through Israel:

Israel and Turkey announced a rapprochement agreement that officially ends a diplomatic crisis since the killing of Turkish nationals during an Israeli military raid on a Gaza-bound aid flotilla in May 2010.

Prime Minister Benjamin Netanyahu praised the deal for its “strategic importance” to Israel, speaking in Rome, as Turkish Prime Minister Binali Yildirim held a press conference of his own simultaneously in Ankara.

“The Middle East is in turmoil. My police is to create islands of stability with our close neighbors,” Netanyahu said, presenting the deal and its clauses as an Israeli interest. “This agreement is good for both sides.”

Well, it’s good for two sides, anyway. Israel will create a $20 million fund to compensate the families of the nine Turks killed and others injured in the Mavi Marmara incident, and cancels the lawsuits and criminal charges in Turkey against Israel and its soldiers. Israel will allow Turkey to send aid, but only through its port in Ashdod. Yildrim claimed yesterday that the deal “largely” lifted the blockade, but Israel had asked the Turks to send its aid through Ashdod before the Mavi Marmara stunt. This appears to be a return to the status quo ante combined with a $20 million payment.

What does Israel get for its $20 million? For one, it gets a diplomatic imprimatur from a major Muslim nation for its Gaza blockade, no matter how Yildrim spins it. The deal gives Netanyahu a major win in international relations, which matters to him politically. Turkey will build infrastructure projects in Gaza — a hospital and desalination plant were mentioned — which will alleviate some pressure on Israel to spend its money on those tasks. Turkey’s investment might make Hamas a little less cavalier about lighting the place on fire, although probably only slightly less.

Hamas winds up the big loser in this deal. Turkey insisted that they consulted with Mashal and assured him that Hamas could still operate its diplomatic mission in Turkey, but that’s small comfort to the leader of the terrorist group. Mashal had Turkey as an ally against the blockade and at least oriented away from Israel’s orbit for several years. That had to have been part of the calculations behind Hamas’ launch of the 2014 Gaza war, which ended badly for Hamas — so badly, in fact, that it stopped Turkey’s attempt to run the blockade again. Now Turkey has all but endorsed the blockade, and at the same time promised Israel that it would push Hamas to release four hostages held for the last couple of years. Mashal and Hamas find themselves more isolated than they have been in years.

Finally, Ha’aretz makes note of a snub from Netanyahu:

Netanyahu also thanked U.S. Vice President Biden for his assistance in the negotiations to reach the agreement, but did not mention U.S. President Barak Obama, during whose March 2013 visit to Israel Netanyahu and Erdogan spoke on the phone, during which time the prime minister apologized for the death of Turkish citizens in the takeover of the Gaza flotilla.

Ouch.