The Somali Islamist movement al-Shabab has for the first time publicly killed a man for "insulting the prophet Muhammed", witnesses have told the BBC.
Crowds watched as the man was shot by a firing squad in the southern town of Jamame in the Lower Juba region.
A BBC Somali service repoter says al-Shabab have previously killed people accused of spying or apostasy.
Last month al-Shabab carried out an attack on Garissa College in neighbouring Kenya, killing 148 people.
The Islamist group controls large swathes of rural Somalia.
Witnesses say that the man was shot by firing squad after he pleaded guilty in a Sharia court trial.
The Islamists have been locked in violent conflict with the Somali government for nearly a decade.
African Union and Kenyan troops have been successfully squeezing the areas that al-Shabab controls.
Kenya has begun building a wall along the length of its border with Somalia in an attempt to halt attacks.