At a joint press conference, Turkey's President Recep Tayyip Erdogan called the agreement historic and says he is convinced that Ethiopia will eventually gain access to the sea.
We have addressed the misunderstandings that have arisen over the past year. Ethiopia wants a secure and reliable access to the sea. This will also benefit all our neighbors, says Ethiopia's Prime Minister Abiy Ahmed.
He said he believed that the talks would make it possible for the two nations to enter the "new year in a spirit of cooperation, friendship, and a desire to work together".
Somalia's President Hassan Sheikh Mohamud says that the agreement has now "put an end to the countries' differences" and that his nation is "ready to work with the Ethiopian leadership and the Ethiopian people".
The conflict between the countries is based on an agreement that Ethiopia reached with the self-proclaimed state of Somaliland on January 1 - an agreement that Somalia condemns and has called an infringement on the country's sovereignty and territorial integrity.
The agreement would give Ethiopia access to the sea through Somaliland and in return, Ethiopia would recognize Somaliland as an independent country.