According to eyewitnesses, the explosion was caused by a mine planted in the café, frequented by government forces.
At least 11 soldiers were injured in the blast.
No group has claimed responsibility for the attack, while the Somali government has yet to issue a statement on the incident.
Somali authorities usually blame attacks on the Al-Shaabab militant group.
englishnews@aa.com.tr