Israel has a new and influential ally after a six-year severance of ties between Jerusalem and Turkey ended in an agreement to resume contact and cooperation.

Following extensive negotiations, the two regional powers agreed terms, including a $20 million compensation fund for victims of the Israeli commando raid on Turkish aid workers sailing towards Gaza in 2010, leaving nine dead.

In turn, Turkey’s rulers have agreed to help convince Islamists Hamas in Gaza to repatriate two Israeli nationals and the bodies of Oron Shaul and Hadar Goldin, two Israeli soldiers killed in the 2014 conflict.

Officials in Ankara had originally demanded that any resumption in ties between Israel and Turkey would be dependent on Israel lifting its blockade of Gaza, but this condition appears to have been dropped, with a compromise agreed.

The deal, finalised in Rome this weekend, would see Turkey help rebuild key infrastructure in Gaza, with material entering through the port of Ashdod for a 200-bed hospital, a power station and a desalinisation plant, to help ease the Strip’s twin water and energy crises.

Turkey will also be allowed to support major projects in the West Bank, including the industrial zone in Jenin. Both the Palestinian Authority and Hamas have reportedly welcomed the agreement.

Israeli Prime Minister Benjamin Netanyahu announced the news after meeting U.S. Secretary of State John Kerry, who first pushed the two former allies towards reconciliation two years ago.

Both Israel and Turkey stand to gain from resumed ties. Alongside all the diplomatic, security and military benefits, Israel hopes Ankara will become an important energy client once its gas fields in the Mediterranean are fully harnessed.

Turkey could also prove to be a useful intelligence partner, in particular providing Israel with a deeper understanding about armed groups in Syria, and potentially brokering a long-term ceasefire in Gaza, by way of confidence-building measures.