Patrick Kaddu scored the all-important goal late on for the Cranes, who needed to avoid defeat to go through.
Uganda, who had spent nearly 40 years failing to qualify for the Nations Cup, will now contest back-to-back tournaments for the first time since the seventies.
Tanzania can take Group L’s second spot if they win in Lesotho on Sunday.
Should they succeed in Maseru, Tanzania would celebrate only their second Nations Cup qualification – and first since 1980.
“I thank God that I scored the only goal that takes Uganda through to the Nations Cup,” said striker Kaddu, who headed home Allan Kyambadde’s fine cross six minutes from time.
Uganda boast 13 points in Group L, way ahead of second-placed Tanzania, who have five points, while Cape Verde have four and Lesotho two.
Uganda’s Cranes, meanwhile, did reach three tournaments in a row, culminating in both contesting and losing the 1978 final, prior to their lengthy absence.
They picked up their first Nations Cup goal and point in decades when drawing with Mali at the 2017 finals – and will hope for more in Cameroon next June.
Group L concludes in March when Tanzania host Uganda and Lesotho travel to Cape Verde.