Sunday's bombing followed two other attacks by Al-Shabab on Mogadishu hotels earlier this month.
Nervous soldiers fired in the air to disperse a crowd who surged toward the hotel after the blast as medical workers transported wounded victims into awaiting ambulances.
The attack comes as Somali forces backed by troops from the African Union (AU) have launched an offensive, dubbed Operation Jubba Corridor, against Al-Shabab fighters, pushing them out of two key towns. The coalition already drove the group out of the capital.
The Al-Qaeda linked group often carries out such attacks when it feels under pressure by coalition forces.
In a statement issued after the attack, Al-Shabab said the operation was carried out in retaliation for the deaths of dozens of civilians at the hands of Ethiopian forces, which are part of the AU force. In June, Al-Shabab forces attacked an AU military base in Lego, about 60 miles northwest of Mogadishu.
The armed group said the hotel was targeted because it hosts "Western" embassies, which are helping to coordinate the offensive.
The attack came as President Barack Obama was leaving neighboring Kenya for Ethiopia. The president's Africa visit has included discussions about how to deal with the threat of Al-Shabab.
While in Nairobi on Saturday, Obama said that although Al-Shabab had been "weakened," the overall security threat posed by the group remained.
"We have been able to decrease their effective control within Somalia and have weakened those networks operating here in East Africa," he said.
"That doesn't mean the problem is solved."
Wire services
Error
Sorry, your comment was not saved due to a technical problem. Please try again later or using a different browser.