Israel and Turkey reached a deal to restore ties Sunday, ending protracted talks amid years of acrimony following a deadly 2010 raid on an aid flotilla that sought to breach Israel’s security blockade on Hamas-held Gaza, an Israeli official said.

The senior Israeli official said a press conference would be held Monday to announce the details of the historic compromise, with the sides signing on the agreement a day later.

The deal includes $20 million in Israeli compensation for Turkish victims of the 2010 Mavi Marmara incident, as well as a Turkish commitment to help free Israeli prisoners and the bodies of soldiers held in Gaza.

Get The Times of Israel's Daily Edition by email and never miss our top stories Free Sign Up

The official spoke from Rome, where negotiators met Sunday to finalize the agreement and where Prime Minister Benjamin Netanyahu also landed on Sunday for talks with US Secretary of State John Kerry on Palestinian peace efforts..

The official, who spoke on condition of anonymity, said Turkish President Recep Tayyip Erdogan had written a letter committing Turkey to work toward the release of the bodies of two Israeli soldiers being held by Hamas in the Gaza Strip as well as two Israeli civilians reportedly being held in the Palestinian enclave.

“We asked for, and received, a document in which the Turkish president instructs the relevant Turkish agencies to work toward resolution of the issue of those kidnapped and missing,” the official said. “The document is in our hands, that’s what Turkey can do for now.”

The families of Lt. Hadar Goldin and Sgt. Oron Shaul, both killed in the 2014 war in Gaza, as well as Avraham Abera Mengistu, who disappeared into the Strip later in 2014, had called for the government to make sure the return of their sons was included in the agreement. A fourth Israeli man is also being held in Gaza, according to officials.

The Israeli official said the deal would be signed Tuesday by Foreign Ministry Director Dore Gold and his Turkish counterpart.

Word of the highly anticipated deal came six years after an Israeli raid on a flotilla that sought to run the blockade on the Gaza Strip, leading to a melee in which nine Turkish activists were killed. A 10th person died of his wounds years later.

Both sides have been pushing to complete the deal in recent months, with Israel in search of a potential customer for its offshore gas exports and NATO member Turkey wanting to restore its regional clout, analysts say.

The United States has also pushed for the two countries, once close regional allies and economic partners, to resolve the dispute as it seeks cooperation in the fight against extremists from the Islamic State group.

If the agreement is signed, it would go before Israel’s top-level security cabinet for approval on Wednesday, according to media reports and an Israeli official who requested anonymity.

Two of Turkey’s key conditions for normalization — an apology and compensation — were largely met earlier, leaving its third demand, that Israel lift its blockade on the Hamas-run Gaza Strip, as the main obstacle, according to the Israeli official.

Reports in recent days described a compromise on the issue.

Under the reported terms of the deal, Israel will allow the completion of a much-needed hospital in Gaza, as well as the construction of a new power station and a desalination plant for drinking water.

Turkey’s aid to Gaza would also be channeled through the Israeli port of Ashdod rather than sending it directly to the Palestinian enclave, the reports said.

Turkey has also committed to keeping Islamist movement Hamas from carrying out activities against Israel from its country, Hebrew-language media reported Sunday.

Hamas would continue to be able to operate from Turkey for diplomatic purposes, the paper said.

Israel has committed to depositing some $20 million in a fund for compensation for the Turkish victims’ families, the Israeli official said, adding that the money had been agreed to three years earlier.

However, he said the money would only be released once the Turkish parliament passed a law to close legal claims against Israeli military figures over the deadly raid.

Previously tight relations between Israel and Turkey were significantly downgraded after Israeli commandos staged a pre-dawn raid on the six-ship flotilla in May 2010 as it tried to run the blockade on Gaza. Israel maintains the blockade to prevent Hamas, an Islamist terror group committed to destroying Israel, from importing weaponry. A number of Israeli soldiers were also injured in the fighting that ensued upon the flagship Mavi Marmara.

The talks to restore ties, ongoing for months, have been accompanied by a change in tone from Turkish President Recep Tayyip Erdogan.

Erdogan, a stout defender of the Palestinian cause and a supporter of Hamas, in July 2014 accused Israel of “keeping Hitler’s spirit alive” over its offensive in the Gaza Strip that summer.

He has more recently said that “we, Israel and the Palestinians and the region have a lot to win from a normalization process.”

The about-turn came amid a drastic worsening of ties between Turkey and Russia following Ankara’s downing of a Russian warplane over Syria on November 24 of last year, which wrecked several joint cooperation projects, including on energy.

Israel is also motivated to find new allies in the region, in part due to a need for export partners for its natural gas. There has been talk of building a pipeline to Turkey.

It has also found itself under increasing pressure over the lack of any progress on peace efforts with the Palestinians and has sought to build relationships with regional countries partly to counter such criticism.

In addition, normalized ties could open opportunities for further cooperation between NATO and Israel since Turkey’s objections would be lifted, analysts say.

“There’s the question of isolation,” said Dror Zeevi, professor of Middle Eastern studies at Israel’s Hebrew University of Jerusalem.

“Turkey’s lost almost all of its good relations with its neighbors… Israel doesn’t have many friends in the region either.”

Israel imposed its blockade on Gaza in June 2006 after Palestinian fighters there kidnapped an Israeli soldier. The restrictions were tightened a year later when Hamas took control of the enclave.

There have been three wars between Israel and Hamas-led fighters in Gaza since 2008, including a devastating 50-day conflict in the summer of 2014.