Somalia vowed on Tuesday to defend its territory by "any legal means" and recalled its ambassador to Ethiopia after Addis Ababa struck a controversial deal with the breakaway region of Somaliland.
Mogadishu branded Monday's surprise pact that gives Ethiopia long-sought access to the Red Sea a "clear violation" of its sovereignty and appealed to the international community to stand by its side.
The Addis Ababa deal was announced only days after Somalia's central government had agreed to resume dialogue with the separatist northern region after years of stalemate.
Somaliland has been seeking full statehood since claiming independence from Somalia in 1991, a move fiercely opposed by Mogadishu and not recognised internationally.
The "historic" memorandum of understanding (MOU) signed by Ethiopian Prime Minister Abiy Ahmed and Somaliland leader Muse Bihi Abdi gives Ethiopia access to the Red Sea port of Berbera and a military base.
"Somaliland is part of Somalia under the Somali constitution so Somalia finds this step to be a clear violation against its sovereignty and unity," the Somali cabinet said in a statement.
It said the agreement was "null and void with no legal basis and Somalia will not accept it".
"In response to this, the Somali government has recalled its ambassador in Ethiopia for consultation."
The government also said it was appealing to the United Nations, African Union, the Arab League and regional East African grouping IGAD among others "to stand with the right for Somalia to defend its sovereignty and force Ethiopia to adhere to international laws".
In an address to the nation, Prime Minister Barre called for the people of Somalia to stay calm.
"I want to assure you that we are committed to defending the country, we will not allow an inch of land, sea and skies to be violated," he said.
"We will defend our land with any legal means possible... We must unite and forget about our differences to defend our land, integrity and sovereignty."
There was no immediate comment from the Ethiopian government to Somalia's reaction.Â
The deal comes months after Abiy said his country, Africa's second most populous, would assert its right to access the Red Sea, sparking concerns among its neighbours.
Ethiopia 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.Â
Ethiopia's economy has been constrained by its lack of access to the Red Sea, a narrow strip of water between Africa and the Arabian Peninsula.
On the southern coast of the Gulf of Aden, the port of Berbera offers an African base at the gateway to the Red Sea and further north to the Suez canal.Â
Abiy's national security adviser Redwan Hussein said Ethiopia would have access to a leased military base on the Red Sea as part of the agreement.Â
It was not clear when the pact would take effect.Â
In 2018, Ethiopia acquired a 19-percent stake in the Berbera port, according to Dubai-based DP World, which manages the port's operations.
The company itself holds a 51-percent stake, while Somaliland has the remaining 30 percent.
On Friday, Somalia and Somaliland agreed to resume dialogue after two days of talks mediated by Djibouti President Ismail Omar Guelleh, the first of their kind since 2020 when similar negotiations stalled.
The deal was welcomed by IGAD, which Somalia joined only in November, and the British embassy which described it as a "vital step towards reconciliation".
Somaliland, a former British protectorate with 4.5 million people, prints its own currency, issues its own passports and elects its own government.
Although Somaliland has often been seen as a beacon of stability in the chaotic Horn of Africa region, its quest for statehood has gone unrecognised internationally, leaving it poor and isolated.
Political tensions also surfaced there last year, spilling over into deadly violence.