Uganda's military spokesman Brigadier Richard Karemire said Somali troops fired at the convoy and its soldiers retaliated in self-defence.
The Ugandan army said Monday its troops shot dead three Somali soldiers in Mogadishu after a military convoy carrying Uganda's commander came under friendly fire over the weekend.
Friday's incident involving the convoy of Brigadier Paul Lokech, who heads the Ugandan contingent of the African Union Mission in Somalia (Amisom), happened when Somali soldiers established road blocks to lock down the capital after two bomb blasts that killed dozens of people.
'Self-defence'
Uganda's military spokesman Brigadier Richard Karemire said Somali troops fired at the convoy and its soldiers retaliated in self-defence.
"There is absolutely no reason why the Amisom forces in their designated sector of responsibility should have been blocked and fired at en route back to the base after providing critical support and with some victims of the attack being quickly evacuated for urgent medical attention," he said.
"As the incident is being investigated, let it be clear that Amisom rules of engagement provide for self-defence and anyone who fires at these forces becomes a target," he added.
Amisom on Saturday had said some of its troops "transporting injured civilians... were involved in an incident" at a National Intelligence and Security Agency (Nisa) checkpoint near Kilometre-4, the city's main junction.
"The incident is under investigation by both the federal government of Somalia and Amisom," it said in a statement.
This is not the first incident of deadly friendly fire between AU and Somali security forces in Mogadishu.
Friday's first bombing was at an entrance to the hilltop presidential palace complex while a second explosion hit a hotel close to the Nisa headquarters, the presumed target.
The bombings were claimed by the al-Qaeda linked Shabaab militants who are fighting to overthrow the internationally-backed government in Mogadishu, which is defended by 22,000 Amisom troops, including 6,000 Ugandans.