"South Africa condemns these abhorrent acts of terror, for which there can be no justification," international relations department spokesperson Clayson Monyela said in a statement on Tuesday.
"It is deeply despairing that the attacks occurred just as Somalia is beginning to show clear signs of a return to normalcy following the 22-year long conflict."
Two attacks took place in the city on Sunday. In the first, more than 34 people were killed and 58 were injured at a magistrate's court when a group of nine people posing as government officials detonated explosive vests, while another opened gunfire that itself killed 29 people.
The second targeted a Turkish aid convoy, killing five people.
The attacks came a week after international warnings about imminent attacks by the extremist group, al-Shabab, in different parts of Somalia.
Although a military offensive under an African Union peacekeeping banner has pushed al-Shabab from urban strongholds in central and southern Somalia, the attacks reinforced concerns the militants remain a potent force.
"Yesterday's blasts eliminated the dreams of the puppet government. More lethal attacks are coming," Sheikh Abdiasis Abu Musab, al-Shabab's spokesperson for military operations, told Reuters.
"The government and people of South Africa offer sincere condolences to the government and people of Somalia, as well as to the families and loved ones of the deceased," said Monyela. – Sapa, Reuters