Britain has called for restraint over the escalating tensions in the Horn of Africa over an agreement between Ethiopia and the separatist region of Somaliland, a former British protectorate.

Somalia has vowed to defend its territory by "all legal means" after the surprise deal, which gives landlocked Ethiopia long-desired access to the Red Sea, one of the world's busiest shipping routes.

Somaliland -- whose 1991 claim of independence from Somalia is not recognised internationally -- signed the memorandum of understanding with Ethiopia in Addis Ababa on Monday.

"The UK is concerned by escalating tensions in the Horn of Africa," the British embassy in Somalia said on X.

"We reaffirm our full respect for the sovereignty and territorial integrity of the Federal Republic of Somalia," it added.

"We urge restraint and dialogue to peacefully resolve issues."

Somalia has branded the deal an "aggression" by neighbouring Ethiopia and a violation of its sovereignty and appealed to the United Nations and the African Union for urgent meetings.

Somaliland's leadership has said Ethiopia would "formally recognise the Republic of Somaliland" under the deal, but this has not been confirmed by the government in Addis Ababa.

Among international players, the United States, African Union, European Union and the Arab League have called for Somalia's sovereignty to be respected.

But since the accord was signed, several British politicians have used the accord to press for the UK to recognise Somaliland.

"For far too long the UK has not done enough. Now we need to show leadership and ensure Somaliland is recognised by the UK," former defence minister Gavin Williamson said on X on Tuesday.

He called on British leaders "to lead in creating a global framework for recognition which is an extremely important, strategic step".

Somaliland, a territory of about 4.5 million people with a long coastline on the Gulf of Aden, has been on a quest for formal statehood for more than three decades but it remains unrecognised globally, leaving it poor and isolated.

Mogadishu staunchly opposes its independence claim but in reality it exercises little authority over the affairs of the region, which has its own government, security forces and currency.

The memorandum of understanding gives Ethiopia access to commercial maritime services and a military base, with Somaliland leasing it 20 kilometres (12 miles) of coastline for 50 years.

Ethiopia, the second most populous country in Africa and one of the biggest landlocked nations in the world, was cut off from the coast after Eritrea seceded and declared independence in 1993 following a three-decade war.

Addis Ababa had maintained access to a port in Eritrea until the two countries went to war in 1998-2000, and since then Ethiopia funnels most of its trade through Djibouti.