Museveni said the Uganda People's Defence Forces (UPDF) had since recaptured the base from the Islamist group.

"Our soldiers demonstrated remarkable resilience and reorganized themselves, resulting in the recapture of the base by Tuesday," the president said.

Al Shabaab fighters had targeted the base early last Friday in Bulamarer, 130 km (80 miles) southwest of the capital Mogadishu.

Museveni said last week that there had been Ugandan casualties but had not given further details about the attack on the troops, who are serving in the African Union Transition Mission in Somalia (ATMIS).

Al Shabaab, which has said it carried out suicide bomb attacks and killed 137 soldiers at the base, has been fighting since 2006 to replace Somalia's Western-backed government with its own rule based on a strict interpretation of Islamic law.

(Reporting by Kanjyik Ghosh in Bengaluru and Elias Biryabarema in Kampala; Editing by Cynthia Osterman and Daniel Wallis)