The explosion occurred after a car laden with explosives was detonated outside gate of the Mogadishu main port on Sunday morning.
Witnesses also heard gunfire after the explosion.
Al-Shabab armed group has claimed the responsibility for the attack through a statement on its radio station, Radio Andalus.
On Saturday, at least two Somali soldiers have been killed and several others wounded in a car bomb attack on a checkpoint in the outskirts of Mogadishu.
Al-Shabab militants have killed hundreds of people in the past and they still launch deadly attacks against the Somali government officials and civilians.