Vehicle explosion followed by gunfire heard outside a restaurant in the Somali capital.

A car bomb has detonated outside a restaurant in the Somali capital, Mogadishu, killing at least nine people and wounding several others, police said.

Heavy gunfire followed the attack claimed by the armed group al-Shabab. Witnesses told Reuters news agency that the whole district was cordoned off by police.

Police officer Mohamed Hussein said there was confusion over whether gunmen had fought their way inside after the blast and whether a hostage situation was underway.

“So far, we can confirm that nine people have died,” Hussein Said. “The suicide car bomb targeted its entrance. There is gunfire inside… but I am not sure if fighters are inside,” he added.

Al-Shabab, which has carried out a campaign of suicide bombings in its bid to topple the internationally recognised Somali government, claimed responsibility.

“A mujahid (fighter) with his suicide car bomb martyred himself after he rammed into Posh Hotel, which is a nightclub. The operation goes on,” Abdiasis Abu Musab, the group’s military spokesman, told Reuters.

Since losing large swathes of territory to African Union peacekeepers supporting the government, the group has frequently launched raids and deadly attacks in Mogadishu and other regions controlled by the federal government.