"The tally we have made so far indicates that more than 20 people, most of them civilians, were killed in the blast," said Ibrahim Mohamed, a Somali police commander.
He said the toll might rise further as the injured and dead had been taken to different hospitals around the city. It was unclear how many people had been in the vicinity of the blast.
Abdikadir Abdirahman Adem, director of Mogadishu's AMIN ambulance service, said his staff had transported 48 injured people to hospital.
Mogadishu residents described hearing a huge blast outside the city's busy seaport, seeing a plume of smoke that rose above the skyline.
A spokesman for the city adminstration, Abdifatah Omar Halane, said investigations were under way.
The Shabaab group claimed responsibility in a statement distributed on its Telegram messaging account.
It said the target was a military base close to the port and claimed to have killed "nearly 30". The group frequently exaggerates the number killed in its attacks.
Today's attack took place close to the entrance to city port and was large even by Mogadishu's standards.
"I have never witnessed such a blast which caused so much devastation," said local resident Abdukarim Osman.
The attack comes as Somalia is in the process of electing a new government with the much-delayed presidential vote due on December 28.
Disclaimer: No Business Standard Journalist was involved in creation of this content
