Dahir Mohamed Mohamoud, vice chairman of Medina hospital in Mogadishu, said: "Ten people died as a result of their wounds."
Salad Ali Jelle, the deputy defense minister, said the attack would not deter the peacekeepers.
One witness said AU troops returned fire after two rocket-propelled grenades were launched at them, hitting a nearby restaurant.
A senior AU official said no peacekeepers were hurt and that "when the attack happened, they [the AU forces] had already passed".
Salad Ali Jelle, Somalia's deputy defense minister, said the Ugandans suffered no casualties.
"When the explosions happened the streets were full and no one was expecting this and we started running," Hawo Halene, a Mogadishu resident, was reported by Reuters as saying.
About 800 AU peacekeepers from Uganda have arrived in Mogadishu since Tuesday, when they came under mortar fire during a welcoming ceremony at the airport.
The Ugandans are the first peacekeepers to arrive in Mogadishu since the failure of a US and UN operation in 1995.
Meanwhile, on Wednesday, Aden Hashi Ayro, who has described himself as a commander of the Islamic Courts movement, said in an audio tape sent to Mogadishu-based Koran Radio: "It is time for the Somali youth to fight the occupation by Ethiopia and others."
He said: "We will fight for the name of Allah and our country. Let us bring together all our forces to fight the enemy of Somalia."
But Assane Ba, a spokesman for the AU peacekeeping force, has said that "attacks and threats" will not set back the deployment of troops to Somalia.