A senior military officer was shot dead in the Somali capital on Thursday, and al Shabaab militants claimed responsibility.
The al Qaeda-linked group has stepped up gun and bomb attacks in the Horn of Africa nation.
Six people were killed in an attack on a vehicle carrying UN staff in the semi-autonomous Puntland region on Monday, and a suicide bomber killed 10 in a restaurant in Mogadishu on Tuesday.
“Gunmen killed my colleague, Major Sabriye today. They hit him with several bullets in the heart and he died. The attackers escaped,” Colonel Abdullahi Hussein, a military officer, told Reuters.
Al Shabaab, which wants to impose its own strict interpretation of Islamic law, often targets officials and politicians for assassination.
African Union peacekeeping forces pushed al Shabaab out of Mogadishu in 2011, but it has kept up guerrilla-style attacks, looking to overthrow the government.
It has in the past also attacked Kenya, Uganda and Djibouti, which all have contributed troops to the peacekeeping mission.
It claimed responsibility for a massacre at Garissa University College on April 2 that left 147 dead and 79 injured.
In a separate incident on Thursday, Kenyan officials said they suspected the group was behind the abduction of a chief in Mandera which borders Somalia.