Captain Mohamed Hussein said a bomb believed to have been concealed in the restaurant often frequented by government soldiers in the Hodan district went off on Saturday evening.
There was no immediate claim of responsibility for the bombing, but suspicion centered on the Islamic extremist group al-Shabab, which is waging an insurgency against Somalia's weak government.
Al-Shabab, al-Qaida's East African affiliate, is fighting to impose a strict version of Islam in the Horn of Africa nation.