Police say two people were killed in a second bomb attack in the Madina district of the city.
It is not clear who staged the attacks. Mogadishu is a regular target for the al-Qaeda linked al-Shabab group, which is battling the government.
After the first blast, police captain Mohamed Hussein told Reuters news agency: "It was a truck bomb. There are casualties but we do not know the exact amount as the scene is still burning."
Witnesses told the BBC they believed dozens of people were dead.
A BBC Somali reporter at the scene said the Safari Hotel had collapsed, with people thought to be trapped under the rubble.
Mogadishu resident Muhidin Ali told news agency AFP it was "the biggest blast I have ever witnessed, it destroyed the whole area".
More about: #Somali