The two al-Shabaab assassins were convicted for the murder of a traditional elder in Mogadishu.
The assassins identified as Ali Hassan 25, and Abdirahman Isse Ali 22 were reportedly caught red-handed to the police after they killed elder Hilowle Heefow Hussein.
Judges of Somali military court said Ali and Hassan who are members of the armed group al-Shabaab were convicted of killing Hussein in Wadajir district last year.
The Deputy Chairperson of Somali military court, Mohamed Abdi Mumin who was present at the scene of an execution in Mogadishu on Monday morning said the court found sufficient evidence to support the charges leveled against the two.
They were executed by firing squad.
Somali military court handles terror-related cases mainly against the members of the armed group al -Shabaab.
The court has previous sentenced several armed group members found guilty of murder and taking part in the attack against the government of Somalia.
Last Sunday, the court sentenced ex-Somali soldier to death for murder and three other suspects to three years in jail for assembling explosive devices in Baidoa, Southwest state.
Human rights group have several times urged the Somali government to cease the capital punishment and replace it with jail terms.