A car bomb exploded at the gate of the Afrik hotel and was followed by gunshots heard inside, Somali police captain Ahmed Hassan told CNN. The incident occurred at about 5 pm local time (9 am ET), added Hassan.
Armed men from the Al Qaeda branch, Al-Shabaab, gained access to the building after the car bomb exploded at the gate, he said.
An operation is underway to rescue people from inside the hotel, police said. It is not clear at the moment whether there are victims.
The reason for the attack is also unclear, but Hassan said an important military commander was inside the hotel at the time of the attack. Other military officers and lawmakers were also inside the hotel, said Hassan.
The hotel is frequented by members of Parliament, politicians and security officials, but not by foreigners.
Outside the hotel is the main security checkpoint at the airport and at Halane base, which houses Western missions, including the U.S. Embassy.
Al-Shabaab took responsibility for the attack in a statement broadcast by Radio Andalus, its spokesman. CNN was unable to independently verify this statement.
US troops in Somalia mainly train and advise local Somali forces during the battle against Al-Shabaab. The US military also carries out air strikes against the group and the local ISIS affiliate in the country, killing an important Al-Shabaab leader in a targeted attack in September.
Omar Nor reported from Mogadishu and Radina Gigova wrote from Atlanta, Georgia.