Militants killed Youssef Siyad, an official with Somalia's ministry of planning and international cooperation, while on his way to work, eyewitnesses told The Anadolu Agency.
Security forces arrived at the site of the incident and arrested several people as potential suspects, the witnesses added.
Planning and International Cooperation Minister Yusuf Ali Aynte, for his part, expressed his condolences, adding that Siyad was killed by "enemies of peace and stability."
Responsibility for the attack has yet to be claimed by any group.
Since the outbreak of civil war in 1991, the troubled country in the Horn in Africa has remained in the grip of on-again, off-again violence.
However, fractious Somalia appeared to inch closer to stability recently after government troops and African Union forces – deployed in the country since 2007 – drove Al-Shabaab from most of its strongholds.
The militant group, yet, has continued to stage attacks against government forces and African peacekeepers.