Abdifatah Omar, the spokesman for Mogadishu municipality, said on Wednesday that intelligence agents had killed the man, only identified by the first name Daud.
Omar did not provide any information when the operation was carried out.
Daud was reportedly in charge of al-Shabaab's intelligence division, known as Amniyat.
Car Bomb Kills 10 in Somali Capital
Separately, ten people lost their lives and a dozen others were wounded when a car bomber crashed his vehicle into a gate outside Hotel Ambassador on Maka al-Mukarama Road in the center of the Somali capital. The sound of fierce exchanges of gunfire could be heard later on.
Al-Shabaab militant group later claimed responsibility for the car bomb attack, saying some of its members had stormed the premises.
In another incident, security forces from the semi-autonomous Jubbaland region killed 16 al-Shabaab terrorists in Bulagadud, located about 30 kilometers (18.6 miles) north of the Indian Ocean port city of Kismayo.
The developments came less than a day after al-Shabaab militants detonated a bomb in Somalia's semi-autonomous Puntland region, killing two soldiers.
Major Mohamed Abdi, an officer in the region's military, said the soldiers were killed late on Tuesday, when their military convoy struck two improvised explosive devices as it was heading toward Galgala Hills, which lie east of Puntland commercial capital city of Bosaso.
“We lost two soldiers and four others were injured. Al-Shabaab planted two bombs as our convoy headed to Galgala Hills,” Abdi said.
Al-Shabaab's military operations spokesman, Sheikh Abdiasis Abu Musab, later claimed responsibility for the act of terror.
“We eliminated 17 Puntland soldiers and destroyed two of their vehicles using bombs yesterday,” he said on Wednesday.
Somalia has been the scene of militancy by al-Shabaab since 2006. The Takfiri terrorist group has been pushed out of Mogadishu and other major cities by government forces and the African Union Mission in Somalia (AMISOM), which is largely made up of troops from Ethiopia, Uganda, Burundi, Djibouti, Sierra Leone and Kenya.
Puntland lies outside the area of operation of AMISOM, which deploys some 22,000 troops in the Horn of Africa state.
S/SH 11