“The suicide bomber tried to enter the compound but guards stopped him, when he then detonated his bomb, killing three people on the spot including himself,” said Farah Barre, a government security official.
“Two more people died soon after from their wounds,” he said, adding the attack on Wednesday morning took place at Villa Baidoa, a government military base near the busy K4 intersection in central Mogadishu.
Three other explosive devices were safely defused elsewhere in Mogadishu Wednesday, Somali information minister Abdulkadir Hussein said, blaming all incidents on Islamist Shabaab insurgents.
“They are engaged in a campaign of terrorising the civilian population,” Hussein said in a statement, calling the attacks “cowardly actions of desperate and anti-Islamic criminals.”
“Al Shabaab are nothing more than murderers of children and civilians,” he added.
No group immediately claimed responsibility for the attack, the latest in a string of blasts including roadside bombs and grenade explosions that have rocked Mogadishu in recent weeks.
The war-torn city has seen an increase in such attacks since the Al-Qaeda linked Shabaab abandoned fixed positions there in August and switched to guerrilla tactics against the Western-backed government.
Witnesses said the bomber had tried to disguise himself as a government soldier to gain access into the compound, where senior army commanders were based.
“I saw a man dressed in military uniform trying to enter the gate but he was stopped, and then minutes later I heard the huge blast,” said Ahmed Mahmud, who was drinking tea on the street nearby.
“I saw four bodies being carried away, and the bits of the body of the bomber were scattered around.”
In October, a Shabaab suicide bomber detonated an explosives-laden truck, killing at least 82 and wounding many more, the bloodiest such attack in the group’s history.
The hardline insurgents control large parts of southern Somalia but are facing increasing pressure from regional armies and government forces.
Kenyan troops are battling the rebels in the far south, Ethiopia forces are in the south and west, while Ugandan and Burundian soldiers in the African Union force in Mogadishu are supporting government efforts.