MOGADISHU - A suicide bomber from Somalia's Shebab insurgents killed at least 12 people and wounded 27 others Monday by ramming a vehicle packed with explosives into a convoy of African Union troops, officials said.

The attack, the latest in a string of killings, comes exactly one week after a US airstrike killed the chief of the Al-Qaeda-linked Shebab rebels, Ahmed Abdi Godane, prompting threats of retaliation from the extremists.

"The car packed with explosives hit one of the armoured trucks... 12 civilians in a minibus were killed, and 27 others were wounded," local governor Adukadir Mohamed Sidi told AFP.

The bomb, which Shebab spokesman Abdulaziz Abu Musab called a "blessed attack" is the first major assault since the Shebab commander was killed in the US strike.

The Shebab boasted of killing foreigners including four Americans and a South African in the attack, but witnesses and the government said there was no evidence to back up the claim.

Two soldiers from the African Union Mission in Somalia (AMISOM) were wounded in the attack, Sidi added.

The attack took place near the town of Afgoye, some 30 kilometres (20 miles) northwest of the capital Mogadishu.

Witnesses reported a huge blast and a wave of fire, with civilians on the busy highway between the town and the capital caught up in the explosion.

"I saw two minibuses with pools of blood, many civilians were killed," said Ali Muhidin, a witness. "The explosion was enormous."

Somalia's government on Saturday warned of a wave of retaliatory attacks by the Shebab following the killing of their commander.

On Friday the Pentagon confirmed that Godane, the leader of Al-Qaeda's main affiliate in Africa, died in an attack in which US drones and manned aircraft rained Hellfire missiles and laser-guided bombs on a gathering of Shebab commanders.

The strike against Godane came days after African Union troops and Somali government forces launched "Operation Indian Ocean", a major offensive aimed at seizing key ports from the Shebab and cutting off multi-million dollar exports of charcoal, one of their key sources of revenue.

AU forces are targeting Shebab on several fronts, with Ugandan troops leading the offensives against the main port of Barawe, south of Mogadishu.

The 22,000-strong AMISOM force, with soldiers drawn from six nations, have been fighting alongside government troops against the Al-Qaeda-linked Shebab insurgents since 2007.

The Shebab have appointed a new commander, Ahmad Umar Abu Ubaidah.

The group have vowed to avenge the death of Godane and said they would continue their fight to topple the country's internationally-backed government.

Al-Qaeda has backed the new chief, according to a statement broadcast repeatedly on the Shebab's official Radio Andalus.

The statement vowed revenge for the killing of Godane.

"You will feel the pain soon and there will be an accountability in the coming days - everyone has his day," it said.

The attack on the AU convoy came hours after soldiers in the internationally funded force were accused of gang-raping women and girls as young as 12, and trading food aid for sex, in a damning report by Human Rights Watch.

"Some of the women who were raped said that the soldiers gave them food or money afterwards in an apparent attempt to frame the assault as transactional sex," the HRW report said.

The vulnerable women largely came from camps in the capital Mogadishu, having fled rural Somalia during a devastating famine in 2011.

The AMISOM force said the alleged rapes were "isolated" incidents and called the report "unbalanced and unfair".

AMISOM donors include the United Nations, European Union, Britain and the United States.

Conditions in Somalia remain dire, with the United Nations and aid workers warning that large areas are struggling with extreme hunger and drought, three years after famine killed more than a quarter of a million people.