THE rivalry between Saudi Arabia and the United Arab Emirates (UAE) on one side and the Gulf state of Qatar on the other is spilling poison into the Horn of Africa, embittering animosities between half a dozen countries in the region. Several of them have seized an opportunity to benefit from instability in the Arabian peninsula by offering bases. But if Arab conflicts spread, countries in the Horn could be dragged into the fray.

Broadly speaking, the regional imbroglio pits two camps of Muslims. One is a more vigorously Islamist lot, including Qatar and Turkey, which have been friendly towards the Muslim Brotherhood, an Islamist movement spanning many countries, and seek better relations with Iran. The other is an alliance led by Saudi Arabia, the UAE and Egypt, whose governments all loathe the Brothers and proclaim themselves as moderate Sunnis particularly hostile to the Shia version of Islam promoted by Iran.

But peripheral countries are being affected, too. According to one recent report, not confirmed by independent sources, Egypt has deployed troops in Eritrea near the latter’s border with Sudan. This followed a bout of bad blood in which Egypt’s government accused Sudan’s of boosting the Brotherhood, which ruled Egypt for a year from 2012 until overthrown by General Abdel-Fattah al-Sisi, now Egypt’s president. On January 15th Eritrea’s long-serving president, Issaias Afwerki, furiously denied the report, saying that “outright lies” had been “repeated ad nauseam by an assortment of Eritrea’s detractors” led by Qatar and its influential broadcaster, Al Jazeera.

The civil war just across the Red Sea in Yemen, where Iranian-backed Houthi rebels are fighting a Gulf coalition led by Saudi Arabia and the UAE, is further increasing regional tension. The countries of the Horn of Africa have been called on to take sides; many officially espouse neutrality, yet offer naval and military facilities.

A merry-go-round of island-swapping and port-lending is taking place. Even before the Yemen conflict erupted, Djibouti had earned billions of dollars by providing France (its former colonial master), America and China with military bases. Until a recent row it also hosted the UAE, which now uses a base in the Eritrean port of Assab, close to Djibouti, as a key spot from which to attack Houthi positions in Yemen. Sudan, which has deployed troops as part of the Gulf coalition against the Houthis, has been making friendly noises to Qatar, and has recently enraged Egypt by letting Turkey develop an old Ottoman port at Suakin, on the Red Sea. Egypt, for its part, last year delighted Saudi Arabia by ratifying an agreement that two small uninhabited islands near the Gulf of Aqaba belonged to the kingdom.

Somalia has been particularly friendly to Turkey and leans towards the Islamist camp. But Somaliland, the internationally unrecognised breakaway statelet on the Red Sea coast, which functions far better than the supposed mother country, has done a big deal with the UAE. The Emirates are building another base there and paying for a new road to connect Somaliland’s port of Berbera with landlocked Ethiopia. To confuse matters more, some of Somalia’s federal states, displaying their own quasi-independence, have made deals that seem to flout the foreign policy of the federal capital, Mogadishu. For instance, Somalia’s north-eastern statelet of Puntland last year signed a deal with the UAE to develop its port, Bosaso, to the annoyance of the government in Mogadishu. A hashtag called #HandsOffSomalia has become popular among Somalis prickly about what they see as infringements of their sovereignty.

Ethiopia tries to keep out of the regional spat, though it is still at loggerheads with Egypt over the nearly completed Great Renaissance Dam in Ethiopia, which Egypt says will drastically curb the flow of the Nile river. The Ethiopians are cosy with Turkey, a big investor, but have also put out friendly feelers to the UAE. Recently, by way of balance, they let Al Jazeera open an office in Addis Ababa, Ethiopia’s capital.

In any event, Ethiopia is likely to oppose anything Eritrea supports: the two countries’ armies still glower at each other across a disputed border, though full-scale fighting ceased in 2000. Meanwhile Eritrea has seized the chance to boost its depleted coffers. Not only has it let the UAE build its base at Assab, by the mouth of the Red Sea. Eritrea is also said to let Israel, which has quietly provided intelligence to Saudi Arabia on Yemen, have discreet use of facilities in the Dahlak archipelago, along with a listening station on an Eritrean mountain. The Houthis in Yemen accuse the Saudis of cosying up to the Israelis—a most heinous crime in some Islamist circles.