Uganda have qualified for the Africa Cup of Nations for the first time since 1978 after beating Comoros on Sunday.
Their 1-0 victory secured their place at next year’s finals in Gabon as one of the two best group runners-up.
Group D rivals Burkina Faso also qualified with a late 2-1 win over Botswana to finish top of the table.
Tunisia and DR Congo qualified as winners of their groups and Togo went through as the second best group runners-up on goal difference.
Sixteen teams will compete at next year’s tournament, which runs from 14 January to 5 February: the 13 group winners and two best group runners-up, plus hosts Gabon.
Algeria, Cameroon, Egypt, Ghana, Guinea-Bissau, Ivory Coast, Mali, Morocco, Senegal and Zimbabwe had booked their places before Sunday’s matches.
Burkina Faso, who lost to Nigeria in the 2013 final, left it very late to guarantee their qualification after Prejuce Nakoulma’s 18th-minute opener was cancelled out by a Botswana equaliser from the penalty spot.
Visitors Botswana fought to hold their opponents, despite having Lesego Galenamotlhale dismissed on 61 minutes and Kabelo Dambe sent off with two minutes of normal time remaining.
But Banou Diawara struck deep into injury time for the Burkinabe, who had Steeve Yago sent off moments before, to give them the victory and 13 points from their six group games.
Uganda also reached 13 points, thanks to a 35th-minute winner by Farouk Miya in Kampala, but they finished in second place in the group because of a inferior head-to-head record against Burkina Faso.
However, it was enough to send the Cranes to the finals for the first time for 38 years. Some Ugandan players raised their arms and others sank to their knees at the end of the match.
Uganda’s last appearance at the Nations Cup ended in a runners-up spot when they lost to Ghana in the final.