The blast at a security checkpoint has also left over 90 civilians, mostly students, injured, according to Mogadishu Mayor Omar Muhamoud.
Abdiqadir Abdirahman, the director of the Aamin Ambulance service, said the death toll was likely to rise.
Sharing the full story, not just the headlines
Abdirizak Mohamed, a Somalian MP, reported the toll could be as high as 90 people, with most being civilian casualties.
The bomb exploded during morning rush hour in Mogadishu and targeted a tax collection centre, according to police.
Images from the scene showed the mangled frames of vehicles and bodies lying on the ground after what was one of the deadliest attacks to hit the Somalian capital in recent times.
University students and two Turkish nationals are among those killed in the east African country, according to officials.
No one has claimed responsibility for the explosion.
Al-Shabab, an al-Qaida-linked Islamist militant group, often carries out such attacks.
The extremist group was pushed out of Mogadishu several years ago but continues to target high-profile areas such as checkpoints and hotels in the seaside city.
Al-Shabab was blamed for a devastating truck bombing in Mogadishu in October 2017 that killed more than 500 people, but never claimed the attack.
A suicide bomber set off their device in the office of Mogadishu’s mayor in July, killing at least 6 people and the mayor, Abdirahman Omar Osman. The extremist group said it was responsible for the blast.
Additional reporting by Associated Press