Turkish President Recep Tayyip Erdogan said the leaders of Somalia and Ethiopia had reached a deal to end a nearly year-old bitter dispute following hours of talks in Ankara on Wednesday.