Civilians and new recruits were among the casualties, the Garowe news portal quoted a military official as saying, adding that scores of people were wounded, Xinhua reported.
The terrorist group Al-Shabaab claimed responsibility for the attack, according to other local media.
Somali National Army forces backed by pro-government militia killed more than 100 al-Shabaab militants on Thursday evening during an offensive at a village in Hiran region of central Somalia.
A week ago in Mogadishu, twin car bomb explosions targeting Somalia's Education Ministry building killed at least 100 people and injured more than 300 others.
Al-Shabaab has been fighting for more than a decade to topple Somalia's central government and to establish its own rule.