The text is secret and the deal might yet fall through. But the memorandum of understanding signed by Ethiopia and Somaliland on January 1st has sent shock waves through the Horn of Africa. Somaliland, which declared its independence from Somalia in 1991, says that Ethiopia will become the first country to grant it recognition. In return, it will give its landlocked neighbour access to the sea.

The deal has outraged Somalia, which describes it as an act of “aggression”. In April it expelled the Ethiopian ambassador. Now it is threatening to do the same to more than 8,000 Ethiopian soldiers who are stationed on its soil to fight al-Shabab, a jihadist group linked to al-Qaeda. But in Somaliland, a de facto state with its own government, flag, army, currency and courts, the mood is very different. “We are struggling for our independence, as every other country in the continent…has done,” says Muse Bihi Abdi, the president of Somaliland, speaking to The Economist in Hargeisa, the capital.

Sitting stiff-backed in his presidential palace, Mr Bihi rehearses the arguments for Somaliland’s statehood. The territory it claims was once ruled by the British; the southern part of Somalia, with its capital at Mogadishu, was under Italian control. The two former colonies united in 1960, but the marriage was an unhappy one. Rebels from Somaliland rose up against a dictatorship, which killed tens of thousands of civilians and bombed Hargeisa into oblivion—a trauma that explains support for separate statehood today. When Somalilanders unilaterally declared independence in 1991, they said they were dissolving a union between states, not starting a breakaway country from scratch. “We are not secessionist,” says Mr Bihi, a former soldier who has held office since 2017.

Even so, the idea of breaking up a state unnerves other African governments, many of which face separatist movements of their own. None has recognised Somaliland, a land of 6m people, which has now ruled itself for longer than it was ever governed from Mogadishu. Hence Mr Bihi’s bargain with Ethiopia, which lost its own coastline in 1993 with the secession of Eritrea. “They need the sea as we need recognition,” he explains. “We are ready.”

Map: The Economist

Mr Bihi says that Ethiopia will lease a strip of coastline between Lughaya and Bulhar, some 20km by 20km, on which to build a naval base (see map). Ethiopia has said that it will consider its position on Somaliland, but has not given a public guarantee of recognition. A full agreement is still being hashed out.

Even if Ethiopia recognises Somaliland, others may be reluctant to follow. Foreign governments have weighed in to support the sovereignty of Somalia, which was voted in as a non-permanent member of the UN Security Council on June 6th. Egypt, which is already irked by an Ethiopian dam on the Nile, has pledged to defend Somalia. White House officials are concerned that the fallout could disrupt the fight against al-Shabab. “Why are the Americans against this?” asks Mr Bihi in exasperation. “They never explained to me.”

Mr Bihi also has critics at home. His defence minister resigned after the deal was announced, saying that Ethiopia is an enemy. Plain-clothes security officers in Hargeisa raided a TV station and detained journalists who were hosting a live debate about it; a pop star was arrested after questioning the agreement in song. (The government says neither arrest was related to the deal.) Moustafa Ahmad, a researcher in Hargeisa, says that popular feeling is “very mixed”, combining excitement about recognition, concern about transparency and scepticism about whether Ethiopia will honour its side of the bargain.

Meanwhile, in the eastern town of Las Anod, the push for statehood faces its biggest challenge since the formative years of the 1990s. People there have long felt ambivalent about independence, which they say has disproportionately benefited the majority Isaaq clan. Last year leaders in Las Anod declared they wanted to be part of Somalia instead. Mr Bihi tried to shell the city into submission, as more than 100,000 people fled from their homes, only for his army to have been forced to retreat last August. That was “a humiliation”, says Mahmoud Adam Jama (known as Galaal) of the opposition Waddani party. “[Somaliland’s] argument was that we control the territory,” he sighs. “Now we don’t.”

Mr Bihi swats away suggestions that he has been too heavy-handed, saying that internal strife is “a stage that all countries go through”. His argument is unlikely to win over critics ahead of the elections in November. In its short history, Somaliland has done better than many nations at forging a degree of consensus and stability. But as it chases recognition abroad, there is still hard work to be done at home.