Fighting between Somali government forces backed by the African Union Mission in Somalia (Amisom) andAl Shabab rebels left at least 20 people dead in two villages in Hiran province.
Somali officials were quoted as saying that the clashes erupted when the rebels launched an attack on a military base run by Amisom.
Somali military officials said all victims are rebels. The fighting came hours after a car loaded with explosives was detonated at the gate of the presidential palace in Mogadishu, killing at least four people and wounding a dozen others, witnesses and officials said.
The Shabab, a militant Islamist group affiliated with Al Qaeda, claimed responsibility for the attack, saying it targeted senior Somali and foreign officials.