About 40 people were injured, said Ahmed Abdulle, a senior official in the capital’s Wadajir district.
The bomb may not have targeted the market, but another destination, and exploded too early, according to the police.
Heavily populated Wadajir district has no government buildings, military installations or other typical terrorist targets.
Witnesses said the fatalities included children and at least 10 women. Some business premises collapsed, while others caught fire.
No group immediately claimed the attack, but suicide bombings are often staged by the radical Islamist group al-Shabaab.