A remote-controlled bomb hit a vehicle in a troop convoy in the southern Somali port city of Kismayu, killing at least three soldiers, police and residents said on Sunday.
Militant group al-Shabab claimed responsibility for the attack, which hit the convoy as it drove through Gulwade village in Kismayu late on Saturday.
"The bomb was targeted at our convoy. Three soldiers were killed," said Ismail Hussein, a police officer in the city.
Al-Shabaab has been weakened considerably by African Union troops and the Somali army, losing swathes of territory in the south of the country, but it has been carrying hit-and-run style attacks to show it has not been vanquished.
Local residents said troops in the convoy opened fire after the blast went off, killing two women who were passing by.
Hussein of the local police rejected the claim, "The forces did not kill residents after the blast," he said.
Sheikh Abdiasis Abu Musab, al-Shabab's spokesman for military operations, said the group was behind the bomb attack and that it killed four senior intelligence officers.
The group also attacked a police station in the port of Bosasso with grenades and guns on Saturday, said Bashir Ahmed, a police captain in the area in the semi-autonomous region of Puntland.
They repulsed the attackers, but a woman who was selling khat, a narcotic leaf, sustained injuries from the fighting, Ahmed said.
Abu Musab confirmed they had carried out the attack, saying that four policemen were injured.