Ethiopia insisted on Wednesday that its controversial deal with the breakaway region of Somaliland broke no laws after Somalia accused its neighbour of a blatant attack on its sovereignty.
The agreement, signed in Addis Ababa on Monday, has raised concerns about the stability of the turbulent Horn of Africa region.
Hundreds of people joined a demonstration in Mogadishu to denounce the pact that gives Ethiopia, one of the biggest landlocked countries in the world, long-sought access to the Red Sea.
Addis Ababa defended the agreement, saying other countries had done deals with Somaliland in the past, but the Arab League and Egypt said they backed Somalia's stance.
East African regional grouping IGAD voiced its "deep concern" about the developments, while the European Union insisted Somalia's sovereignty should be respected.
Mogadishu has vowed to defend its territory "by any legal means" and called for urgent meetings of the UN Security Council and the African Union to discuss Ethiopia's "aggression".
The wide-ranging 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.
Somaliland, a former British protectorate of about 4.5 million people, declared independence from Somalia in 1991, a move not recognised internationally and staunchly opposed by Mogadishu.
But in reality, Somalia's fragile central government exercises little authority over the affairs of the region, which has its own constitution, government, security forces and currency.
While Somaliland remains largely stable, Somalia has witnessed decades of civil war and a bloody Islamist insurgency by the Al-Qaeda-linked Al-Shabaab militant group.
In a Mogadishu stadium, hundreds of people, mainly students, joined a demonstration, waving banners declaring "Our sea is not for sale and we will not allow to lose an inch of our land".
"These people feel that their unity has been violated," Mogadishu mayor Yusuf Hussein Jimalehe told the rally. "They feel that part of their land is to be looted and they have gathered here to reject that aggressive ambition."
The demonstrators chanted slogans against Somaliland president Muse Bihi Abdi and Ethiopian Prime Minister Abiy Ahmed who signed deal.
Ethiopia and Somalia have a history of stormy relations and territorial feuds, fighting two wars in the late 20th century.
Somaliland's Bihi had said in a statement that in exchange for the sea access, Ethiopia would "formally recognise" Somaliland.
But the Ethiopian government has not confirmed this assertion.
It said in a statement the deal "includes provisions for the Ethiopian government to make an in-depth assessment towards taking a position regarding the efforts of Somaliland to gain recognition".
But it said that despite Somaliland not having full recognition, it has nevertheless signed agreements with various countries, including on port development.
"Yet there has been no murmur or complaint when this materialised," it added.
"No party or country will be affected by this MOU. There is no broken trust nor is there any laws that have been transgressed."
The deal was signed just days after Somalia and Somaliland agreed to resume dialogue after decades of stalemate.
It also follows comments by Abiy last year that Africa's second most populous nation 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 maritime access, and the Berbera port in Somaliland offers a gateway to the Red Sea and further north to the Suez Canal.
IGAD voiced "deep concern" about the development in relations between Somalia and Ethiopia and urged the two neighbours to "collaborate towards a peaceful and amicable resolution of the situation."
But Somalia's government blasted the IGAD response, saying it "falls short of condemning the Ethiopian government of violating the sovereignty and territorial integrity of Somalia".