Residents of the town of Galkayo in north central Somalia said they heard two loud blasts in quick succession followed by heavy gunfire.
"There were two huge bombs. The first one was a truck bomb, followed a minute or so (later) by another car bomb. My brother was injured at the scene," Halima Ismail, a local resident, told Reuters.
Islamist al Shabaab, which has carried out a series of deadly attacks in the Horn of Africa country as it seeks to topple the Western-backed government, claimed responsibility for the bombings.
"There were two suicide car bombs," Abdiasis Abu Musab, the group's spokesman for military operations, told Reuters.
Police initially put the death toll at 10, including civilians and security forces personnel, but a medical official said that number had doubled.
"Death toll is over 20 and it may rise further," said Ahmed Sugule, a doctor at Galkayo hospital. He said another 30 people were wounded in the attack.