According to witnesses, the blast on Thursday was caused by a bomb that exploded near a hotel in southern Mogadishu where an African Union (AU) team was staying.
Witnesses said all the victims were Somali civilians, but Mogadishu governor Abdullahi Ganey told reporters he believed the bomb had been intended for the AU team, which has been looking at security and logistics for the peacekeepers.
"I assume the bomb was targeting the AU mission, but still we shall investigate who was behind this attack," he said.
The AU delegation, which left the capital on a previously scheduled visit to the northern town of Jowhar shortly after the explosion, had been due to pass by the site of the bombing.
The team had arrived in the country on Monday after the pan-African organisation authorised the deployment of peacekeepers to help Somalia's transitional government relocate from exile in Nairobi to Mogadishu.
There has been a series of assassinations of former soldiers and police officers in recent months by unidentified armed men. Visiting BBC producer Kate Peyton was shot dead in an unsolved attack in Mogadishu on 9 February.
A new Somali government still based in Kenya where it was formed at peace talks has asked the African Union and Arab League to supply 7500 peacekeepers to help disarm militiamen roaming the capital, though no decision on size has been made.
"I assume the bomb was targeting the AU mission, but still we shall investigate who was behind this attack"
The Transitional Federal Government was formed last year in the safety of Nairobi, tasked with bringing order to a country torn apart by 14 years of strife between rival clan-based regional commanders.