The explosion happened just outside a restaurant near the ministries of internal security and youth.
"Seven people, most of them in the coffee shop, were killed in the blast. We carried wounded bodies into the hospital," police officer Hussein Ahmed told Al Jazeera, adding at least eight others were wounded.
Police were forced to fire into the air to disperse onlookers as they struggled to pull people from the rubble, believing the death toll could rise further.
While nobody has yet claimed responsibility, it is believed that the militant group al-Shabaab, which has carried out repeated attacks against African Union Mission in Somalia (AMISOM), and Somali troops, as well as indiscriminately targeting civilians, is behind the attack.
In March, 10 people were killed and scores wounded in three separate car bombings.
However, the Somali government is confident that it is winning the war against the fanatics after successfully driving them out of large swathes of the country over the last few years.
“We are 100 percent confident of re-establishing our presence in most of the country as al-Shabaab has weakened significantly."
Several prominent leaders from the group have been killed and its economic situation has declined,” Somali Embassy spokesperson Abdi Dakane told the African News Agency (ANA).
“The group is also losing support among Somalis with only a minority still supporting them after previously winning over converts by claiming al-Shabaab was the true face of Islam and not the government,” said Dakane.
“However, through bitter experience following the indiscriminate slaughter of civilians people now understand how twisted their version of Islam is."
“I’d put the number of people who still currently support the militants at around 20 percent. And even these people are having second thoughts about their continued support because many of them are afraid of being killed themselves if they leave the group,” Dakane told ANA.
He believes Somalia will succeed in driving al-Shabaab out of the country completely by around 2020.
“Significant advances by Somali forces, and (AMISOM) troops, against the group began in earnest in 2015,” said Dakane.
“Hitherto al-Shabaab controlled about 60 percent of Somalia, including some villages near Mogadishu. However, today they control only small parts of the country and are hiding away in several rural areas.”
The group has denounced has denounced Somali President Mohamed Abdullahi Mohamed, who was elected in February as an "apostate" and warned Somalis against supporting him and have vowed to continue their attacks.