Two of Turkey's key conditions for normalisation of ties with Israel -- an apology for the deadly 2010 raid on the Mavi Marmara aid ship and compensation for those killed in the raid -- were largely met, as the two countries reached some kind of compromise according to Turkish prime minister.
A third demand, that Israel lifts its blockade on the Hamas-run Gaza Strip, was partially met.
Israel, which had already offered its apologies for the raid, agreed to pay out $20 million to the bereaved and injured, Turkish PM Binali Yildirim announced during a press conference in Ankara on Monday.
The two nations will exchange ambassadors as soon as possible after a six-year rupture, and the deal would be signed on Friday, Yildirim said.
Under the deal, Turkey will deliver humanitarian aid and other non-military products to Gaza. The first shipment of 10,000 tonnes of aid will be sent next Friday, Yildirim added.
A senior Turkish official described the deal as a "diplomatic victory" for Turkey, although Israel has not completely agreed to lift the Gaza blockade.
The highly anticipated agreement comes six years after the Israeli raid killed 10 Turkish activists as the international aid flotilla they were participating in sought to break the blockade on the Gaza Strip.
Israeli Prime Minister Benjamin Netanyahu also formally announced the deal at 10:00 GMT from Rome.
He said rapprochement will create 'stability' in a turbulent Middle East.
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 to resolve the dispute as it seeks cooperation in the fight against the DAESH terrorist group in Iraq and Syria.
Speaking after a meeting with Netanyahu on Monday, US Secretary of State John Kerry welcomed the agreement, saying, "We are obviously pleased in the administration. This is a step we wanted to see happen."
Negotiations were said to have been held in Rome, where Netanyahu landed for talks with Kerry on Sunday.
The agreement between Turkey and Israel is expected to go before Israel's security cabinet for approval on Wednesday.
A compromise on Gaza and Hamas
Reports in recent days described a compromise on the status quo of the Gaza blockade and Palestinian organisation Hamas’ relationship with Turkey.
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 by Turkey.
Turkey's aid to Gaza will also be channelled through the Israeli port of Ashdod rather than sending it directly to the Palestinian enclave, the reports said.
According to the deal, Hamas will continue to operate from Turkey for diplomatic purposes, Israeli newspaper Haaretz reported on Sunday.
Netanyahu has come under pressure within Israel not to agree to the deal if it does not include provisions for Hamas to hand over four missing Israelis, including the remains of two soldiers presumed dead and two civilians believed to be being held in Gaza.
The Israeli official said Turkish President Recep Tayyip Erdogan agreed to instruct "all relevant Turkish agencies to help resolve the issue of Israel's missing citizens."
Previously tight relations between Israel and Turkey were significantly downgraded after the raid. The restoration of ties, however, indicate a change in tone from Erdogan.
He has more recently said that Turkey, Israel and the Palestinians and the region "have a lot to win from a normalisation 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, which wrecked several joint cooperation projects, particularly in the energy sector.
Israel was 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 immense implications for the Israeli economy, and I use that word advisedly," Netanyahu told reporters.
Tel Aviv 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, normalised ties could open opportunities for further cooperation between NATO and Israel since Turkey's objections would be lifted, analysts say.
Israel imposed its blockade on Gaza in June 2006 after Palestinian militants 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 Palestinian militants in Gaza since 2008, including a devastating 50-day conflict in the summer of 2014.