Egypt came from a goal down to beat a spirited Guinea side to book their place at next year’s event.
Egypt beat Guinea from behind to book their 26th appearance at the Africa Cup of Nations.
Egypt beat Guinea 2-1 on Wednesday to secure top spot in their qualifying group with a game in hand. Ivory Coast is the eighth country to host the 24-team event next year.
Guinea, who needed just a draw to qualify, took the lead in the 26th minute after Serhou Guirasi finished off a slick passing move in the box.
Almost immediately after the restart, Egypt’s Mahmoud Trezeguet fired a shot that was blocked by the Guinean goalkeeper. The ball fell to captain Mohamed Salah but the Liverpool forward skied the ball over the crossbar from close range.
However, Salah redeemed himself not long after, playing in from the right to Trezeguet, who scored with a foot-of-the-foot finish for the equaliser.
Guinea had few chances in the second half and looked the lively side until Mustafa Mohamed found the ball unmarked in the box in the 78th minute and fired a terrific shot into the top right corner of the goal for victory.
The win ensures Egypt top Group D and will be back for another chance at the African crown, which they have won a record seven times.
The match took place in Marrakesh, Morocco, where Guinea were forced to withdraw from their home stadium, which was declared ineligible for the competition by the Confederation of African Football Officials.
A nine-point defeat for Guinea opens the door for one of the other two teams in the group, Ethiopia and Malawi, who each have three and play on Tuesday.
The winner of that match then gets a chance, but a draw will see Guinea qualify.
Gambia, who were the surprise package of the last tournament where they reached the quarter-finals on their debut appearance, were boosted after a dramatic last-gap goal earned them a 3-2 win over South Sudan.
Gambia moved to nine points with the group win, sharing top spot with Mali, who are away to Congo in Brazzaville on Sunday.
Guinea Bissau’s 1-0 win over Sao Tome and Principe in the Lusophone derby on Wednesday bolstered their chances of qualifying from Group A, where they moved up to 10 points after five games with a one-point lead over Nigeria.
Saturday will see the final round of seven more qualifier matches.