A suicide bomber detonated an explosives-laden vehicle at the gates of a military base, Somali officials said.
The witnesses said that the explosion was heard near Bar-Ayaan junction in Wardhigley district of the city.
The al-Qaida-linked al-Shabaab group claimed responsibility for the attack via its radio arm, Andalus.
Harakat al-Shabaab al-Mujahideen (Movement of Striving Youth), more commonly known as al-Shabaab, is an Islamic group based in East Africa.
In 2012, it pledged allegiance to the organization Al-Qaeda.
Al-Shabaab's troop strength was estimated at 7,000 to 9,000 militants in 2014.
As of 2015, the group has retreated from the major cities; however, al-Shabaab still controls large parts of the rural areas. (ILKHA)