Witnesses said a large convoy carrying troops from African Union Mission in Somalia (Amisom) the AU force fighting the militants, was passing through the area when the bomb went off.
Al-Shabaab controlled the capital until 2011 when it was pushed out by Amisom troops, but it still holds territory in the countryside and launches frequent attacks against government and civilian targets in Mogadishu and elsewhere.