A second blast was heard in the area minutes later. Captain Mohamed Hussein said the gunfire was heard inside the Nasa-Hablod hotel, which is close to the presidential palace and is frequented by politicians and other members of Mogadishu's elite. A senior Somali police colonel and a former lawmaker were among the dead, Hussein said.
Today's blasts came two weeks after more than 350 people were killed in a massive truck bombing on a busy Mogadishu street in the country's worst-ever attack.
As night fell, sporadic gunfire could be heard around the hotel as both soldiers and ambulances responded to the attack.
Mohamed Dek Haji said he survived the bombing as he walked beside a parked car that was largely destroyed by the explosion. He said he saw at least three armed men in military uniforms running toward the hotel after the suicide bombing at its gate.
More From This Section
"I think they were al-Shabab fighters who were trying to storm the hotel," he said, lying on a hospital bed. He suffered small injuries on his shoulder and skull from flying glass.
It has not commented on the massive attack two weeks ago; experts have said the death toll was so high that the group hesitated to further anger Somali citizens as its pursues its insurgency.
Since the blast two weeks ago, President Mohamed Abdullahi Mohamed has visited regional countries to seek more support for the fight against the extremist group, vowing a "state of war."
A 22,000-strong multinational African Union force in Somalia is expected to withdraw its forces and hand over the country's security to the Somali military by the end of 2020.
The US military also has stepped up military efforts against al-Shabab this year in Somalia, carrying out nearly 20 drone strikes, as the global war on extremism moves deeper into the African continent.