JERUSALEM (Reuters) - Israel apologized to Turkey on Friday for killing nine Turkish citizens in a 2010 naval raid on a Gaza-bound flotilla and the two feuding U.S. allies agreed to normalize relations in a surprise breakthrough announced by U.S. President Barack Obama. In a statement released by the White House only minutes before Obama ended a visit to Israel, the president said Prime Minister Benjamin Netanyahu and his Turkish counterpart Tayyip Erdogan had spoken by telephone. "In light of Israel's investigation into the incident which pointed to a number of operational mistakes, the prime minister expressed Israel's apology to the Turkish people for any mistakes that might have led to the loss of life or injury," Netanyahu's office said in a statement in English. It added that he had agreed to conclude an agreement on compensation and said Netanyahu and Erdogan agreed to normalize ties between the two countries, including returning their ambassadors to their posts. Erdogan's office said he had accepted the apology and had told Netanyahu that he valued centuries of "strong friendship and cooperation between the Turkish and Jewish nations." Turkish Foreign Minister Ahmet Davutoglu said that, with the apology, all of Turkey's fundamental demands had been met. Before the diplomatic breakdown, Israel and Turkey shared intelligence information and carried out joint military exercises. Israeli pilots trained in Turkish skies, improving their capability to carry out long-range missions such as possible strikes against Iran's nuclear facilities. Israel had balked at apologizing to the Turks, saying this would be tantamount to admitting moral culpability and would invite lawsuits against its troops. Voicing until now only "regret" over the incident, Israel has offered to pay into what it called a "humanitarian fund" through which casualties and their relatives could be compensated. An Israeli political source said the way to a formal apology was paved by the sidelining of far-right ex-foreign minister Avigdor Lieberman, who opposed the move. He resigned in December after being indicted on fraud charges. A source in Netanyahu's bureau said opening a new chapter with Turkey "can be very, very important for the future, regarding what happens with Syria but not just what happens with Syria." Tzipi Livni, a minister in charge of regional diplomacy, praised what she saw as "restoration of a first-rate strategic dialogue" that could help Israel forge a "camp of more moderate elements" to confront Islamist radicals in Syria and Iran. In Turkey, Erdogan's success in obtaining an Israeli apology was viewed as a diplomatic coup, although the deal fell short of meeting his earlier insistence that Israel remove a blockade on Gaza that it imposed when Hamas Islamists rose to power there. "This is a diplomatic success," said Turkish political scientist Ufuk Ulutas. In a statement, Hamas applauded Erdogan for having won an apology from Israel, and said he had told the group's leader Khaled Meshaal by telephone that Netanyahu also promised to "lift the siege on the Palestinian people." Israel said, however, that it undertook to ease conditions in the Palestinian territories should the situation allow, and that Netanyahu and Erdogan had pledged to work together to improve the humanitarian situation in Palestinian areas, including Gaza. Additional reporting by Dan Williams, Crispian Balmer and Matt Spetalnick and Jonathon Burch and Parisa Hafezi in Ankara, Nidal al-Mughrabi in Gaza; Editing by Tom Pfeiffer