Gunmen sprayed the car of MP Abdulahi Hussein Mohamud with gunfire as he travelled through a southern district of the capital Mogadishu earlier Saturday, killing him, his two guards and the driver.
President Hassan Sheik Mohamud said he was "devastated" at the attack, the latest in a string of murders of Somalia's lawmakers.
"The lawmaker was martyred while serving the nation, but such killings will not deter us from going forward," Mohamud told reporters yesterday.
The Shebab have carried out repeated attacks including a campaign of suicide attacks and assassinations targeting government figures.
UN envoy to Somalia Nicholas Kay called the murders a "despicable act".
Witnesses said the militants fled after the attack.
"They opened fire on the car of the lawmaker and all of the passengers including him died," witness Abdirahman Mire said.
The Shebab is fighting to overthrow Somalia's Western-backed government which is propped up and protected by the 22,000-strong African Union force (AMISOM).
