A huge bomb exploded at the busy hotel, which is frequently used by government officials, local police and witnesses said.
"The forces rescued government officials and members of the public who were trapped in the building," Sadiq Dudishe, spokesperson of the Somali Police Force, told the Somali National News Agency without disclosing the number of casualties.
The police operation was underway to end the siege at the hotel. Witnesses said the extremist group set off the explosion at the gate of the hotel near the presidential palace.
"The government forces arrived at the scene to rescue the people and are still fighting the militants inside the hotel. We can hear gunshots from the hotel," a resident said.
Al-Shabab militants, who have been fighting to topple the government for over a decade, claimed responsibility for the bombing, saying they targeted a gathering of officials at the hotel.
The African Union Transition Mission in Somalia strongly condemned the attack and expressed solidarity with the government and people of Somalia, saying it "applauds Somali security forces for the swift response to prevent further casualties and property damage."