Uganda plans to withdraw its troops from Somalia by December 2017, signalling it is scaling back regional military interventions after it said it planned a similar pullback from Central African Republic.
President Yoweri Museveni has intervened in several regional security hotspots, deploying troops to help quell unrest in Somalia, Central African Republic and South Sudan in recent years.
Uganda deployed in Somalia in 2007, the first of several troop contingents from the region in the African Union-mandated AMISOM force formed to combat al Shabaab Islamist militants, who had established a power base in the Horn of African country.
"Our plan that we have communicated to the African Union is that by December 2017 we want to be out," Paddy Ankunda, Uganda military spokesman, told Reuters late on Thursday.
"So unless something major comes up that's the time we want to come out of Somalia."
Uganda accounts for about a third of the roughly 22,000-strong AMISOM force.
Al Shabaab claimed responsibility for twin bombings in Kampala in 2010 that killed 76 people, which it called a punishment for Uganda's troop deployment in Somalia. Although since pushed out of its strongholds, the group remains a potent and deadly threat.
Paddy declined to give a reason for the planned Somalia withdrawal, which followed a similar announcement two weeks ago concerning Central African Republic, where Ugandan troops have been helping track down fighters from the Lord's Resistance Army rebel group led by Ugandan Joseph Kony.