The al-Shabab group said it carried out the Wednesday afternoon blast.
But the militant Islamists denied that it was a suicide attack as earlier reported by the police.
The attack is the latest of a series of suicide attacks staged by the al-Qaeda-linked group in Mogadishu - after being pushed out last August by the Somali government and African Union troops.
Drinking tea The BBC's Mohammed Dhore in Mogadishu says that seven people died at the scene.
Mogadishu Mayor Mohamed Ahmed Nur said the blast had killed 15 "innocent civilians".
Our correspondent says people were drinking tea at a popular cafe in the heart of Mogadishu's government district, when the bomb exploded.
"There was a heavy explosion, a car full of explosives was detonated," MP Mohamed Iro told the AFP news agency.
The attack took place on the day of a visit to the city by the European Union's new special envoy to the Horn of Africa, Alexander Rondos.
Last week, William Hague was also in Mogadishu, the first visit by a British foreign secretary in 20 years.
The UK government is holding a conference in London on 23 February to try to find a political solution, and tackle piracy and extremism.
On Wednesday, Mr Hague said it would mark the beginning of an enduring engagement to end their country's crisis and announced a series of new approaches.
The mandate of the current transitional government could not be extended after seven years of minimal progress, he said.
But the international community would provide support for internal political discussions now under way between Somalis inside the country on how to replace the government, whose mandate expires in August, the UK foreign minister said.
This might involve a constitutional assembly drawn from all Somalia's communities, he said.
He added that the new major diplomatic push to restore stability in Somalia would include dealing directly with the country's many regional administrations.
This will put areas like the semi-autonomous Puntland on a new footing and provide them with additional aid, BBC Africa analyst Martin Plaut says.
Somalia has been without an effective central government since 1991 and the government in Mogadishu is propped up by a African Union force from Uganda, Burundi and Djibouti.
Kenya and Ethiopian troops are also in Somalia, and analysts say the military fortunes of al-Shabab have dramatically worsened in the last year