A suicide bomber blew himself up in front of a Somali army camp in the southwest of Mogadishu, Al Jazeera reported on Sunday.
About 15 people were killed and 11 others wounded after the suicide bomber raided a former candy factory, according to local media Goobjoog News.
Most killed were new recruits, the report said.
The militant group Al-Shabaab has claimed responsibility for the attack.