Ghana will participate in their 23rd tournament after a 1-1 draw with South Africa in Johannesburg ensured they will finish in the top two in Group C.
South Africa and Sudan will battle it out for the other place in Khartoum on Sunday.
The Gambia, who is one of the continent’s smallest nations secured their place in the next year's Africa Cup of Nations after their home 1-0 win over Angola on Thursday.
The team's qualification was a triumph for journeyman coach Tom Saintfiet, a Belgian who has had numerous jobs around Africa.
Half of the 24-team field for the finals has now been settled with the rest to be determined over the next five days of qualifying matches.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)