Police spokesman Major Mohamed Hussein said the attacker, with explosives strapped to his body, infiltrated the General Kahiye Police Training Academy and struck during a police parade.
Abdikadir Abdirahman, the director of Amin Ambulances, told Reuters: “We have carried 13 dead people and fifteen others who were injured from the police academy.”
The militant Islamist group al Shabaab claimed responsibility for the attack.
“We will give details of casualties later,” said Abdiasis Abu Musab, the group’s military operations spokesman.
Al Shabaab carries out frequent bombings in Mogadishu and other towns.
It is waging an insurgency against the U.N.-backed government and its African Union allies in a bid to topple the weak administration and impose its own strict interpretation of Islam.
The militants were driven out of Mogadishu in 2011 and have since been steadily losing territory to the combined forces of African Union peacekeepers and Somali security forces.