The militant Islamist group al Shabaab claimed responsibility for the attack.
“We will give details of casualties later,” said Abdiasis Abu Musab, the group’s military operations spokesman.
Al Shabaab carries out frequent bombings in Mogadishu and other towns.
It is waging an insurgency against the UN-backed government and its African Union allies in a bid to topple the weak administration and impose its own strict interpretation of Islam.
The militants were driven out of Mogadishu in 2011 and have since been steadily losing territory to the combined forces of African Union peacekeepers and Somali security forces.