Ethiopia has taken the first legal steps on a path that could one day enable the landlocked country tbbc gain access to the sea, its government says.
It has signed what is known as a memorandum of understanding (MoU) with the self-declared republic of Somaliland to use one of its ports.
Ethiopia's Prime Minister Abiy Ahmed has previously described sea access as an existential issue for his country.
His statement in October prompted tensions across the Horn of Africa.
There were some fears, quickly dampened by the authorities, that this implied trying to take land from another of Ethiopia's neighbours, Eritrea.
The details of Monday's agreement with Somaliland have not been made public but a statement from Mr Abiy's office said it would "pave the way to realise the aspiration of Ethiopia to secure access to the sea". Talks leading up to the MoU have focused on the Somaliland port of Berbera.
Mr Abiy's national security adviser, Redwan Hussien, also said on X that the arrangement could also enable Ethiopia to access a "leased military base" on the sea.
An MoU is not legally binding, though it is seen as a statement of intent and can lead to a treaty imposing obligations on those parties who have signed.
Nevertheless, the development is being portrayed by Addis Ababa as a major diplomatic victory.
The prime minister, who signed the MoU with Somaliland's President Muse Bihi Abdi in the Ethiopian capital, wrote on X that "all that can be said is thank God".
Speaking at the signing ceremony, Mr Abdi said the agreement included a section stating that Ethiopia would recognise Somaliland as an independent country at some point in the future.
Somaliland's foreign ministry said in a statement later that the "historic agreement ensures Ethiopia's access to the sea for their naval forces, reciprocated by formal recognition of the Republic of Somaliland, marking this as a significant diplomatic milestone for our country".
It quoted Mr Abdi as saying that recognition came in "exchange for 20km (12 miles) sea access for the Ethiopian naval forces, leased for a period of 50 years".
Ethiopia has not commented on this aspect of the deal.
Somaliland seceded from Somalia more than 30 years ago, but is not recognised by the African Union (AU) or the UN as an independent state.
There has been no response regarding the announcement from Somalia, which considers Somaliland as part of its territory. But national broadcaster SNTV reports that there will be an emergency cabinet meeting on Tuesday to discuss the issue.
Ethiopia lost its access to the sea when Eritrea seceded in the early 1990s. With more than 100 million people, it is the most populous landlocked country in the world.
Up to now Ethiopia has been using the port in neighbouring Djibouti for the vast majority of its imports and exports.
In 2018 Ethiopia and Somaliland signed a deal that should have led to Addis Ababa owning a 19% stake of the port of Berbera, with the Emirati logistics company DP World holding a 51% share.
But this fell through in 2022 as "Ethiopia failed to meet the conditions needed to acquire the stake before the deadline", the authorities in Somaliland reportedly said at the time.