Somalia's militant Islamist movement al-Shabab is battling to keep the loyalty of its fighters, as the Islamic State (IS) group tries to gain a foothold in East Africa.
IS achieved a major boost in March this year when it won the loyalty of the main jihadi group in West Africa - Boko Haram, which is based in Nigeria, Africa's most populous state.
But East Africa - which has a longer history of militant Islamist activity - has so far remained out of its grasp, mainly because of the al-Shabab leadership's loyalty to al-Qaeda.
However, some cracks may be starting to appear in that unified position.
Last month Sheikh Abdulqadir Mumi, a prominent former "spiritual leader" and recruiter for al-Shabab, declared allegiance to IS from his base in the remote Galgala Mountains, in the semi-autonomous region of Puntland, located in north-eastern Somalia.
The move may turn out to be largely symbolic, given that reports indicate only 20 of Mumi's estimated 300 followers opted to switch sides, but it has at least given IS its first official outpost in East Africa.
For al-Qaeda, East Africa has always been a key frontier of jihad. Its most notorious attack, before it brought down the New York Twin Towers in 2001, was the simultaneous bombing of the US embassies in Kenya and Tanzania in 1998, which left more than 200 people dead.
With al-Qaeda significantly weakened since the death of Osama Bin Laden, it has relied on al-Shabab to salvage its credibility in global jihadi circles.
Its attack on Kenya's Garissa University College in April, which killed about 150 people, provided a grim sequel to the Westgate shopping centre attack in September 2013, when at least 67 were killed in a daytime assault in the heart of the Kenyan capital.
These large-scale attacks made al-Shabab a prime target for recruitment by IS, a group which prefers its new members to have proven murderous credentials.
IS has embarked on a sleek propaganda campaign, where high definition videos not only show gruesome beheadings and public executions, but also depict a utopian view of life under the IS "caliphate" in Iraq and Syria: of people harvesting grapes in Raqqa or taking a dip in Mosul's public swimming pool.
This is a tactic - one that al-Shabab has itself copied - to attract jihadists from around the world.
IS has even co-opted Boko Haram, its new affiliate in Africa, to urge Somali militants to join its ranks as part of the Nigerian group's own propaganda machine.
For the most part so far, al-Shabab's leaders have not been swayed by IS attempts to woo them.
They have banned any discussion relating to the group and have detained perceived IS sympathisers in southern and central Somalia, including two senior commanders and some foreign fighters, according to pro al-Shabab media.
The group has also said it would treat defectors as enemies.
Internal tensions have already started to spill over in some cases, with local media reporting at least nine militants killed in fighting earlier this month between two rival al-Shabab factions in southern Somalia.
The repeated warnings from the jihadist group's leaders against defections suggest they see IS as a genuine threat to their own standing and ability to recruit.
Although al-Shabab has carried out big attacks outside its borders - especially on Kenya which has troops on the ground as part of an African Union mission backing the Somali government - the group's priorities are still mainly domestic.
IS advocates global expansion and domination, an ideology that does not sit well with al-Shabab leaders, who would rather focus on matters closer to home.
While the group is happy to take on foreign fighters who serve their own purpose, the idea of taking orders from leaders outside Somalia is not something the al-Shabab hierarchy is keen on.
Somalia's President Hassan Sheikh Mohamud has held up reports of factionalism within al-Shabab as a sign of the group's weakness, but it still holds large swathes of territory in the central and southern regions of the country, and continues to launch deadly attacks in the capital Mogadishu.
There is no doubt that al-Shabab, whatever internal wrangling is currently going on, remains a deadly force within Somalia and in neighbouring Kenya.
If the IS propaganda campaign leads to more defections, it could declare a branch in East Africa, prompting a potentially devastating three-way war between IS, al-Shabab and the Somali government.
It would also herald the arrival of a more potent enemy for other East African governments.