Militants from the al Qaeda-linked group attacked a car carrying Liban Osman, and a lawyer named Abdikadir Mohamed, through the city and shot them both, police Major Mohamed Nur told Reuters.
Osman had just returned from abroad and was about to start working as the director of a Mogadishu hospital, Nur added.
Al Shabaab’s military operation spokesman, Sheikh Abdiasis Abu Musab, said the group targeted Osman because he was “a very important official at the presidential palace”.
Somali troops and African peacekeeping forces drove al Shabaab out of Mogadishu in 2011.
But the group, fighting to overthrow the government and impose its strict version of Islamic law, has continued to wage guerrilla-style gun and grenade attacks.
Somalia’s government declined to comment.