Mogadishu police official Mohamed Abdi said the dead were civilians, and a spokesman for the African Union peacekeeping mission in Somalia known as AMISOM said two soldiers were wounded in the attack near Mogadishu's international airport.
"We have two minor injuries. This is not something that can stop AMISOM from stabilising Somalia," said spokesman Col. Ali Aden Houmed.
The military convoy was returning from its regular patrol of stations in Mogadishu where African Union troops are based when the attack happened, he said.
The blast blew the bomber into pieces, he said, and then the soldiers started firing into the air to disperse people.
More From This Section
It was not immediately clear who was responsible for the attack, but the al-Qaeda-linked rebels of al-Shabab frequently stage similar attacks in Mogadishu.
Somali Prime Minister Abdi Farah Shirdon condemned the attack saying the sporadic terrorist attacks will not derail the progress being made in Somalia.
African Union forces expelled al-Shabab from Mogadishu in August 2011, ending years of daily violence that had caused the rest of the world to shun the capital for two decades.
After the ouster of al-Shabab the international community started trickling back into the capital, and the United Nations began moving its personnel to Somalia from Kenya.
But the extremists of al-Shabab still hold sway in large parts of rural southern Somalia and retain the ability to stage lethal attacks even in Mogadishu. Last month militants on a suicide mission invaded the UN compound in Mogadishu with a truck bomb and then poured inside, killing at least 13 people before dying in the assault.