"Two gunmen shot a legislator near his hotel tonight, they shot him in the head and shoulder and he died instantly," AFP quoted Somali security official Liban Mohamed as saying.
Kalif Jire Warfa was shot dead on Sunday evening after he left a mosque. The shooters managed to escape the scene.
Violence has escalated in Mogadishu as the battle between government forces backed by African Union (AU) troops and al-Shabab fighters continue.
Government forces carried out an attack on Friday, killing more than 37 al-Shabab fighters and capturing some bases in Mogadishu.
The seized positions mistakenly came under heavy shelling by AU troops, leading to the death of at least 30 Somali soldiers.
Somalia has also been hit by one of the most disastrous humanitarian crises in the world. More than 3.4 million Somalis affected by the recent famine and drought are in dire need of assistance.
However, the World Food Program has said it cannot reach 2.2 million Somalis who live in territory controlled by al-Shabab in south-central Somalia.
Meanwhile, the untimely rain that has come too late to relieve the drought-hit areas in Somalia, added to refugees' misery when it damaged many of the makeshift homes in the capital Mogadishu on Sunday.