Police told CNN the country's former defense minister, Mohamed Nur Galal, is confirmed dead in the attack. Officials did not provide further details and did not confirm whether there were more casualties in the ongoing battle.
Somali Prime Minister Mohamed Hussein Roble sent condolences following Galal's death.
"My heartfelt condolences to the families of the victims of the heinous terror attack in Hotel Afrik including Gen Mohamed Nur Galal who served his country with valor for over 50 years," Roble said via Twitter. "This attack is yet another reminder of the savage enemy we face. We must unite against terror."
A car bomb exploded at the gate of Afrik hotel and was followed by gunfire heard inside, Somali police captain, Ahmed Hassan, told CNN. The incident occurred around 5 p.m. local time (9 a.m. ET), Hassan added.
Gunmen from the al Qaeda affiliate Al-Shabaab gained access to the building after the car bomb explosion at the gate, he said.
There is an ongoing operation to rescue people from inside the hotel, according to police.
The reason for the attack is also unclear but Hassan said a top military commander was inside the hotel at the time of the attack. Other senior military officials and lawmakers were also inside the hotel, Hassan said.
The hotel is frequented by members of Parliament, politicians and security officials, but not foreigners.