"The police targeted areas we believe have been hideouts for Al-Shabaab operatives who have been behind recent attacks in the city," National Security Ministry spokesman Mohamed Osman told The Anadolu Agency by phone.
"We had good intelligence before the raid," he said.
The security operation was conducted in Mogadishu's oldest district of Hamarweyn.
Several small arms were confiscated and the suspects are expected to be brought before court later this week.
"We are interrogating suspects we believe have links to Al-Shabaab and other militant groups, including clan militia," Osman said.
Although Al-Shabaab were pushed out of Mogadishu by African peacekeepers and the Somali army, the group has continued to target government officials and foreign troops in the capital.
"This security sweep in Mogadishu will continue as long as we feel there is some threat to the stability we have managed to restore in our city in the past few years," Osman insisted.
Five government soldiers and ten members of the Ahlu Sunna Waljama'a militia were killed in clashes in the city of Dhusamareb, in the central province of Galguduud, on Saturday.
Though Ahlu Sunna, which controls several areas in central Somalia and is known to fight against Al-Shabaab, supports the Somali government, the group accuses the government of marginalization.
The fight has reportedly been triggered by a disagreement regarding the formation of the new state of Galgadud.
Somalia has remained in the grip of on-again, off-again violence since the outbreak of civil war in 1991.
Earlier this year, the country appeared to inch closer to stability after government troops and African Union forces – deployed in the country since 2007 – drove the Al-Qaeda-linked Al-Shabaab group from most of its strongholds.