The first explostion - in the city's K5 Junction area which is lined with government offices, hotels, and restaurants - destroyed several buildings and set dozens of vehicles on fire.
"We know that at least 20 civilians are dead while dozens of others are wounded," said Abdullahi Nur, a police officer who was in the area.
Somalia security chief killed by own guard, al Shabaab claims responsibility
"The death toll will surely rise. We are still busy transporting casualties," he said, adding that there were bodies under the rubble.
About two hours later, a second blast took place in the city's Madina district. "It was a car bomb. Two civilians were killed, " Siyad Farah, a police major, told Reuters, adding that a suspect had been caught on suspicion of planting explosives.
There was no immediate claim of responsibility, although the al-Shabaab group has carried out regular attacks.
Somali insurgent group al Shabaab kills general with suicide car bomb
The al-Qaeda-allied group is waging an insurgency to topple the weak UN-backed government and its African Union allies and impose its own strict interpretation of Islam.
They frequently launch gun, grenade and bomb attacks in Mogadishu and other regions controlled by the federal government, though in recent years the militants have lost most territory under their control to African Union peacekeepers and government troops.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ