A military court in Uganda has found two officers guilty of cowardice during an attack by Islamist fighters who stormed an African Union base in Somalia in May.
At least 50 Ugandan soldiers were killed in the attack, officials say.
The convicted officers, Majors Zadock Abor and John Oluka were said to have ran away after they came under attack by al-Shabab in Bulo Marer, south of the capital of Somalia, Mogadishu.
Uganda is part of the African Union force helping Somalia’s government fight al-Shabab, an al-Qaeda affiliate.
The attack on Bulo Marer was one of the deadliest for the African Union force codenamed ATMIS, since it launched a new offensive against al-Shabab last year.
Uganda’s President, Yoweri Museveni, criticised his military for its response.
The Ugandan military court sitting in Mogadishu heard that the officers had been given warning of an impending attack but failed to act to deter it.
As al-Shabab gunmen stormed the base, the soldiers failed to rally their troops and instead ran away to another base.
Both officers have been dismissed from the army.
Four non-commissioned officers were also found guilty of failing to protect military equipment.
The 19,000-strong African Union force was sent to Somalia in 2007 and they helped force al-Shabab out of many cities.
It is scheduled to handover security responsibilities to Somalia’s government forces and leave the country next year despite al-Shabab holding control of many rural parts of the country.