The attack underlines the challenge facing Mohamed, who has inherited an administration with limited control over Somali territory due to the presence of al-Shabaab, and is heavily propped up by the international community.