Security official Mohamed Adan told AFP news agency the "huge blast" was caused "by a trucked loaded with explosives".
Windowpanes and doors in buildings far from the scene were destroyed.
The explosion appeared to target a hotel on a busy road in Hodan district and at least 15 people were injured, police Capt. Mohamed Hussein said.
Police said people were trapped in the rubble of the Safari Hotel, which was largely destroyed in the explosion.
"The scene turned deadly very immediately" Ali Abdullahi, a witnesses said, "This is the largest explosion I ever heard". Witnesses said the blast occurred amid a traffic jam.
The attack has not been claimed in the immediate future, but the islamist somali shebab linked with Al-Qaeda launching frequent attacks and suicide bombings in Mogadishu and its surroundings. Windows of nearby buildings were shattered.
The attacks follows after political impasse between the Federal government of Somalia and its member states, in what many believe could have been foreign interest based political interference. Overturned cars lay in the street, burning.
Saturday's blast comes two days after Somalia's defence minister and army chief both resigned from their posts without explanation.
However, the militants continue to control rural areas and launch attacks on military, government and civilian targets in Somalia, as well as terrorist raids in neighbouring Kenya. Two civilians were killed, " Siyad Farah, a police major, told Reuters, adding that a suspect had been caught on suspicion of planting explosives.