The incident came shortly after Ugandan soldiers, the vanguard of an African Union (AU) force, began arriving this week in Mogadishu to tame the anarchy that has usually reigned in the Somali capital since 1991.
Estimates of civilian death
Also on Saturday, a local human rights organisation said that more than 1,700 civilians have been killed and 2,000 have been wounded in Somalia in the past year.
Elman Human Rights Group said most of the deaths from March 9, 2006, to March 10, 2007 had occurred in Mogadishu, one of the most violent and gun-infested cities in the world.
The group based the figures on hospital reports and interviews with wounded victims.
Much of the death toll stems from months of battles that culminated in a radical Islamic militia wresting control of southern Somalia from an alliance of warlords in June - before the government took control of the capital again in January.
However in recent weeks, several dozen Somalis have also been killed as remnants of the Islamic courts carried out a series of hit-and-run attacks against government troops and their Ethiopian allies.
Many residents say insecurity is worsening in Mogadishu, with shootings and almost daily assaults on government forces and their Ethiopian allies, who defeated militant Islamists in a swift December offensive.
The Ugandan soldiers were attacked almost as soon as they started landing on Tuesday, and two were wounded in an ambush the following day - raising the spectre of the last peacekeeping mission to Somalia, which ended in failure in 1995.