The blast struck the Aroma cafe in Mogadishu and the bomb was believed to have been detonated by remote control, senior police official Mohammed Hussein said. Most of those who died were sitting outside the cafe, he said.
No group has claimed responsibility for the attack, but suspicion has fallen on the al-Qaida-linked al-Shabab militants who have vowed to avenge the death of their leader, Ahmed Abdi Godane, who was killed in early September in a US airstrike. Godane has been replaced by Ahmed Omar, also known as Abu Ubeid.
The Somali government troops backed by AU forces are making progress in capturing the remaining al-Shabab strongholds.
Last week, they captured the port town of Barawe. Earlier today, gunmen shot and seriously wounded a Somali television reporter, officials said.
The African Union Mission in Somalia, or AMISOM, condemned the attack on the reporter, who was shot three times while fleeing from the gunmen.
The attack is the third targeting journalists in Somalia this year, AMISOM said. Somalia remains one of the most dangerous places in the world to be a journalist. Last year, 18 journalists were killed in Somalia.