Algeria will face the Ivory Coast, the only team they failed to defeat in winning the last Africa Cup of Nations, when Cameroon host the 2021 edition between January 9 and February 6 2022.
The teams drew 1-1 after extra time in the quarter-finals and the Desert Foxes advanced by winning a penalty shootout.
Matches decided by spot-kicks are officially classified as draws by Fifa, and it was the only time in a seven-match march to the title that Algeria needed a shootout to succeed.
Algeria and the Ivory Coast were placed in Group E with Sierra Leone and Equatorial Guinea when the draw was made in Yaounde on Tuesday.
It would be a shock if the Algerians and Ivorians did not fill the top two places, leaving the other two countries to fight for possible qualification as one of the four best third-placed teams.
Although ranked third in the continent this month behind Senegal and Tunisia, Algeria are the form team as they boast an African record 27-match unbeaten run since November 2018.
Cameroon, seeking a sixth Cup of Nations title, were put in Group A with Burkina Faso, who they will face in the opening match in Yaounde, Ethiopia and Cape Verde.
It is hard to imagine the Indomitable Lions failing to make the last 16 and Burkina Faso will also be confident of progressing.
Record seven-time African champions Egypt share Group D with three-time title-winners Nigeria, Sudan and Guinea-Bissau, who have been transformed from minnows to qualifying three times in a row.
Group A: Cameroon, Burkina Faso, Ethiopia, Cape Verde
Group B: Senegal, Zimbabwe, Guinea, Malawi
Group C: Morocco, Ghana, Comoros, Gabon
Group D: Nigeria, Egypt, Sudan, Guinea-Bissau
Group E: Algeria, Sierra Leone, Equatorial Guinea, Ivory Coast
Group F: Tunisia, Mali, Mauritania, Gambia
Note: Group winners and runners-up and the four best third-placed teams qualify for knockout stage