At least six people were killed and about ten injured when a car laden with explosives rammed into a cafeteria in central Mogadishu and blew up on Monday.
Bursts of gunfire followed the attack, which targeted the Italian Coffee cafeteria located near the passport office.
The Somali militant group Al Shabab claimed responsibility for the attack.
"A suicide car bomb was driven into the cafeteria before exploding. We do not know about casualties yet," Major Aden Ibrahim, a police officer said.
In recent years, the Al Qaeda-linked group has lost large swathes of its territory to African Union peacekeepers supporting the UN-backed government.
But the insurgents frequently launch deadly gun, grenade and bomb attacks in Mogadishu and other regions controlled by the federal government. Many attacks are aimed at military bases but some also target civilians.
In February the group threatened to escalate attacks in a "vicious war" against the new government of President Mohamed Abdullahi.
Earlier on Monday, three Somali soldiers on a ordnance-clearing mission were killed after a roadside bomb planted by the insurgents exploded 90 kilometres (60 miles) north of the capital.
Somalia has been mired in conflict since 1991, when clan-based warlords overthrew dictator Siad Barre and then turned on each other.losion and gunfire in Somali capital Mogadishu