At least 15 others were injured when the car packed with explosives and parked near a busy security checkpoint by the city's airport was detonated by remote control, said Capt. Mohamed Hussein.
Responsibility for the attack was claimed by Somalia's homegrown Islamic extremist rebels, al-Shabab, who are allied to al-Qaida.
The powerful explosion which rocked Mogadishu occurred in the morning when many people were on the road going to work and others were travelling to attend the Hajj pilgrimage in Saudi Arabia's Mecca.
Many of the victims injured by the bomb blast have suffered critical wounds, said witnesses.
Ambulance sirens echoed across the blast scene as soldiers at a nearby checkpoint fired in the air to disperse onlookers who gathered nearby and to stop motorists trying to speed through the site amid the chaos.
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.