No one immediately claimed responsibility for the attack, but the al Qaeda-linked Islamist insurgent group al Shabaab frequently launches large attacks in Somalia.