The Al Shabaab on Friday claimed in a statement that it had carried out suicide bomb attacks and killed 137 soldiers at the base.
The assaulted military base housed Ugandan forces with the African Union peacekeeping mission in Somalia.
A Somali army captain said both sides suffered heavy casualties.
Since 2006, Al Shabaab has been fighting to topple the Horn of Africa country’s Western-basked government and establish its own rule based on a strict interpretation of Islamic law.
The militants targeted a base belonging to the African Union Transition Mission in Somalia (ATMIS) in Bulamarer, 130 km (80 miles) southwest of the capital Mogadishu. ATMIS is assisting Somalia’s federal government in its conflict with al Shabaab.
“There was an attack this morning at our base… by elements of al Shabaab but we are waiting for official communication from ATMIS headquarters,” said Uganda People’s Defence Force (UPDF) deputy spokesman Deo Akiiki.
ATMIS later said in a statement that al Shabaab had hit the base using car and suicide bombers, and that airborne reinforcement from the mission and its allies destroyed the militants’ weaponry as they withdrew.
ATMIS gave no details on casualties.
Some Somali media however said “many, many Ugandan soldiers had been killed or captured”.
Al Shabaab said in a statement that it had carried out suicide bomb attacks and killed 137 soldiers at the base.
There was no immediate official confirmation of the casualties. Al Shabaab tends to give casualty figures in attacks that differ from those issued by the authorities.
The militants had also targeted an adjacent base belonging to the Somali military, a Somali 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 Shabaab suffered heavy casualties,” he said.
Residents of the town said they awoke to the sound of huge explosions and heavy weapons.
“Now we see al Shabaab 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 earlier on Friday.
Al Shabaab once held vast swathes of Somalia before being pushed back in government counter offensives since last year. However, the militants remain capable of launching significant attacks on government, commercial and military targets.