Al Shabaab gunmen and a suicide car bomber struck a religious center in central Somalia on Monday, killing a cleric and at least 14 of his followers, a police officer said.
The Islamist militant group had accused the cleric of insulting Prophet Mohamed, which he denied.
The group was forced from Mogadishu in 2011 and most towns and cities but it retains a strong presence outside the capital and launches frequent bombings and other attacks in a campaign to topple the federal government.
Al Shabaab is fighting to establish its own rule based on its harsh interpretation of Islamic law.
The group took responsibility for the attack and put the number of dead at 26. It said some soldiers who responded to the first attack also died as they tried to remove a second car bomb.