The jihadist group al-Shabaab has driven Africa Union forces out of the town on Janale, located about 90 kilometers south of the capital Mogadishu.
At least 12 Ugandan troops were killed in the fight.
The Somali government dismissed concerns over the attack, saying that the area is not strategically valuable.