"A suicide bomber disguised as a member of the military managed to enter inside the training camp... Several soldiers were killed and others wounded but we have not established the exact number so far," Lieutenant Colonel Mohamed Abdirahman told AFP.
The training camp in the south of the capital is one of the largest in the country.
Yesterday, a suicide bomber drove a car packed with explosives into a convoy carrying army chief Ahmed Mohamed Jimale who was named to the post last week by President Mohamed Abdullahi Mohamed.
The Al-Qaeda-linked extremists claimed responsibility for the attack, saying the military chief had "narrowly escaped" the blast which left at least 10 people dead.
More From This Section
While Shabaab have lost large swathes of territory and were forced out of Mogadishu by African Union troops in 2011, they continue to strike in the capital and countryside.
There has been an uptick in attacks over the past week, with a car bomb in Mogadishu that left seven people dead Wednesday, a landmine that killed 19 on Thursday and a mortar strike which left three dead on Friday.