The militants attacked the base belonging to the African Union Transition Mission in Somalia (ATMIS) in Bulamarer, 130 km southwest of the capital, Mogadishu.
"There was an attack this morning at our base... by elements of al Shabab but we are waiting for official communication from ATMIS headquarters," said Uganda People's Defense Force (UPDF) deputy spokesman Deo Akiiki.
Al Shabab claimed in a statement that it carried out suicide bomb attacks and killed 137 soldiers.
A Somali military captain who gave his name as Abdullahi told Reuters from the Lower Shabelle region "That prompted a fierce battle for hours. All groups including al Shabab suffered heavy casualties."
Residents of the town said they woke up to the sound of huge explosions and heavy weapons.
"Now we see al Shabab in the town. We cannot know how many died. We are not hearing any shots from ATMIS and government now," local resident Rukia Farah said.
There was no immediate official confirmation of the casualties and the group tends to give figures that differ from those issued by the authorities.
ATMIS has been assisting Somalia's federal government in its war against the Islamist group. The mission was assessing the security situation, it said on Twitter, without providing details.
Forum