The attack was followed by gunfire, which targeted the Italian Coffee cafeteria, located near the immigration office in Mogadishu, reports said.
More than 10 people were injured in the attack, according to medical officials.
Somalia’s capital saw a wave of deadly suicide attacks by Al-Shabab armed group in the first few weeks of 2017, but the number had dropped until recently.
In recent, President Mohamed Abdulahi Farmajo of Somalia has declared an offensive against the group, which wants to topple internationally-recognized government based in Mogadishu.