He said that 30 Shabaab militants had been killed, while the Islamists claimed in a statement to have killed 59 Ugandan soldiers.
The incident occurred when heavily armed al-Shabab fighters attacked the African Union Mission base in Somalia (AMISOM).
A police major stationed in a nearby town also said two auto bombs exploded outside the base before the al Shabaab fighters entered it.
The gunmen on Sunday detonated at least two cars at the military camp in the town of Bulo Marer, before engaging soldiers from African Union Mission in Somalia (AMISOM).
It frequently targets Amisom bases and Somali government institutions - attacks that have intensified recently, even as American strikes against the group have increased. Farah Osman of the Somali Army, who is stationed near the base.
The Ugandan military, meanwhile, has only confirmed the deaths of four soldiers. "Then al Shabaab attacked this morning as a revenge", he said.
Local officials quoted by The Guardian said that as many as 46 Ugandan troops were killed by the al-Qaeda affiliated group in Somalia's south.
US forces have been working with the Somali government to fight al-Shabaab for years, but under President TrumpDonald John TrumpNew York Magazine cover depicts Trump as a pig GOP lawmaker: Republicans "would be well advised to get ready" for Dem wave in midterms Tech giants brace for sweeping European Union privacy law MORE airstrikes and ground troops have significantly increased.
Al-Shabab militants, however, still retain a significant presence, reportedly roaming freely and posing a threat in regions outside the capital where the central government has little control. The group attacked a peace group in Somalia.
This article has been adapted from its original source.