The blast and a second, smaller one nearby appeared to target those heading to work on what was a business day in the Horn of Africa nation.
A plume of smoke rose over the capital as ambulances rushed to the scene.
"At first I saw a vehicle driving to and fro, then we tried to stop people walking here and there, and then in the blink of an eye the vehicle exploded, causing havoc," traffic police officer Mohamed Harun told The Associated Press.
Al-Shabab, the most active Islamic extremist group in sub-Saharan Africa, was pushed out of Mogadishu years ago but continues to control large parts of rural southern and central Somalia.
The US military, which partners with Somali forces and a 20,000-strong African Union peacekeeping mission, has greatly increased airstrikes against al-Shabab under the Trump administration. At least 47 US strikes have been carried out this year.