Three members of the United Arab Emirates armed forces and an officer from Bahrain were killed yesterday Saturday in a “terrorist attack” in Somalia, the UAE Ministry of Defense announced. The statement emphasized that the attack occurred while soldiers were “carrying out their duties” during training of Somali armed forces at a base in Mogadishu.

The perpetrator of the attack was a Somali recruit, who was shot and killed. “The soldier opened fire on trainers from the United Arab Emirates and Somali officers when they started to pray,” a military official who spoke on condition of anonymity told Reuters news agency earlier. It pointed out that the attacker “had defected from (jihadist group) Al-Shabaab before being recruited by Somali and UAE forces.”

The jihadist group, which maintains strong ties to al-Qaeda, claimed responsibility for the attack on the Mogadishu base, claiming its fighters killed 17 soldiers.

For 16 years, al-Shabaab has been waging an armed struggle against Somalia’s internationally-backed federal government to overthrow it and impose its own extreme version of Islamic law on the country.