Israel and Turkey have reached an understanding that could lead to the restoration of ties between the two former allies, an Israeli official said Thursday.

Relations between the two countries broke down in 2010 after an Israeli naval raid on a Gaza-bound flotilla that killed eight Turkish citizens and one Turkish-American. In the aftermath of the raid, Turkey became one of the strongest critics of Israeli actions in Gaza.

Israel apologized to Turkey for the deaths and agreed to compensate the victims' families under a U.S.-brokered arrangement in 2013. But efforts to restore ties faltered amid new Israeli action in Gaza.

The Israeli official, who spoke on condition of anonymity because he wasn't authorized to speak to the media about the diplomatic talks, said the sides agreed that Israel would compensate the families of the flotilla victims.

The official said Turkey would waive legal claims against Israel over the raid and that the countries would upgrade diplomatic ties by returning ambassadors. A leader of the Islamic militant group Hamas said to be based in Turkey will be banned from operating from the country.

A U.S. official familiar with the agreement confirmed the details. He also spoke on condition of anonymity because he wasn't allowed to talk to the media about the subject.

The Israeli official said the understanding requires final approval, adding that it was achieved between the incoming head of Israel's Mossad Yossi Cohen and the Turkish Foreign Affairs Undersecretary Feridun Sinirlioglu.

The official also said talks to lay down a natural gas pipeline from Israel to Turkey would begin soon.

Earlier this week, Turkish President Recep Tayyip Erdogan signaled a possible warming of relations with Israel, saying in published comments that the entire region would benefit from the normalization of ties.