Unidentified armed attackers have taken control of a hotel in the Somali capital, Mogadishu, following two car bomb blasts and gunfire, police and intelligence officers said on Friday.

"Two car bombs targeted Hotel Hayat. One hit a barrier near the hotel and then the other hit the gate of the hotel. We believe the fighters are inside the hotel," a police officer who identified himself only as Ahmed, told Reuters.

Two intelligence officers, who did not want to be named, also confirmed the incident.

Abdikadir Abdirahman, director and founder of Mogadishu's Aamin ambulance services, told Reuters they had so far carried nine wounded people away from the hotel.

There were no more details available on any casualties. A Reuters witness said that the explosions subsided and sporadic gunfire was still heard from the hotel's direction.

The al Qaeda-linked al Shabaab group has claimed responsibility for the attack, according to a translation by the SITE Intelligence Group, which monitors Jihadist group statements.

Al Shabaab has been fighting to topple the Somali government for more than 10 years. It wants to establish its own rule based on a strict interpretation of Islamic law.

The Hayat Hotel is a popular venue with lawmakers and other government officials.

Police officers were conducting an operation aimed at stopping the attack, the state-run Somali National News Agency said on its Twitter account, citing a police spokesperson.

"The unsung heroes of Somali Police Special Unit have rescued many people from Hayat Hotel in Mogadishu as the security forces are dealing with terrorist incident," the agency later added.

The agency also posted a picture showing smoke billowing from above the scene.

Friday's attack is the first major attack since President Hassan Sheikh Mohamud took office in May.

Al Shabaab has claimed responsibility for similar attacks in the past. In August 2020, it said it was behind an attack on another hotel in Mogadishu in which at least 16 people were killed.