The attack, the latest in a string of bomb blasts and killings in Somalia, came as US President Barack Obama left neighbouring Kenya and headed to Ethiopia, both key nations contributing troops to the African Union force battling the Al-Qaeda-affiliated group.
In a statement quoted by jihadist websites, the Shebab said they attacked the Jazeera Palace hotel, which is also home to the diplomatic missions of China, Qatar and the United Arab Emirates and is popular among Somali government officials and foreign visitors.
Local resident Abdihakim Ainte, a political analyst, was nearby when the bomb exploded and described a "huge blast" that smashed his window.
He said the hotel had been "torn apart" by the blast, and photographs shared on social media showed the side of the six-storey hotel demolished by the explosion. The enormous blast also sent a thick plume of smoke high into the air.
More From This Section
Mogadishu resident Mohamed Moalim was at the hotel when the bomb exploded.
The AU force in Somalia (AMISOM) said it was helping to evacuate the wounded.
The Jazeera, close to the fortified international airport, houses the United Nations, Western diplomatic missions and AMISOM. The hotel has been the target of Shebab attacks in the past, including in 2012 when suicide bombers stormed the hotel while President Hassan Sheikh Mohamud was inside.
The Shebab are fighting to overthrow Somalia's Western-backed government which is propped up and protected by the 22,000-strong AMISOM force.