The Al-Shabaab terrorist group claimed responsibility for the attack and said Americans and South Africans were among those killed.
MORE: http://www.cnn.com/2014/09/08/world/africa/somalia-violence/index.html
See also...
Al-Shabaab grew amid Somalia's lawlessness
http://www.cnn.com/2013/09/21/world/africa/somalia-al-shabaab-explainer/index.html
12 dead in Islamist attack on Somali prison
http://www.cnn.com/2014/08/31/world/africa/somalia-bombing/index.html