(Reuters) – At least five people, including Somali military officials and a United Arab Emirates (UAE) soldier, were killed on Saturday after a soldier opened fire at a military base in the capital Mogadishu, an army officer and hospital staff told Reuters.
The UAE's defence ministry, however, said three members of its armed forces and one Bahraini officer were killed in a "terrorist act" in Somalia while they were training Somali armed forces.
Two more were injured, the ministry added in a statement.
The ministry did not give other details about the attack but said the UAE "continues to coordinate and cooperate with the Somali government in investigating" the act.
The gunman, a newly trained Somali soldier, was also shot dead at the Gordon military base managed by the UAE, said the army officer, who gave his name only as Ahmed.
"The soldier opened fire on the UAE trainers and Somali military officials when they started praying. Four UAE officers were injured while four Somali soldiers died," the officer told Reuters.
"We understand the soldier had defected from al Shabaab before he was recruited as a soldier by Somalia and UAE," he said.
Al Shabaab, linked to al Qaeda, claimed responsibility for the attack via a statement on its Radio al Andalus and said its fighters had killed 17 soldiers.
Two nurses and a doctor at the Erdogan Hospital in Mogadishu, who asked not to be named, told Reuters a senior officer from the UAE had died and four other officers were seriously injured.
In addition about 10 injured Somali soldiers had been brought to the hospital, they said.
Somalia's President Hassan Sheikh Mohamud in a statement on state media (SONNA) offered his condolences to the UAE following the incident.
Al Shabaab has waged an insurgency against the Somali government since 2006 to try to establish its own rule.