The security forces opened fire while people queued for food cards at a camp for internally displaced people.
The mayor of Mogadishu Yusuf Hussein Jimale said some suspects had already been arrested and others will follow.
The camp houses people fleeing Islamist militants al-Shabab, drought and the country's long-running conflict.
At least 11 people have been killed in Mogadishu after rival Somali security forces argued over who was in charge, witnesses say.