Riyad Mahrez scored twice in Algeria's 4-1 victory over Togo to seal his country's place at the 2019 African Cup of Nations.
Gambia's 3-1 win over Benin the previous day meant victory for Algeria in Lome would guarantee them a top-two place in Group D, and Mahrez ensured they achieved that.
The Manchester City winger opened the scoring in the 13th minute with a superb volleyed lob before doubling his tally on the half-hour with a rasping drive - that coming soon after Youcef Attal had made it 2-0.
Togo were able to pull a goal back but Algeria sealed the win they needed thanks to Baghdad Bounedjah's stoppage-time strike and the Desert Foxes will hope to end a 29-year wait for Cup of Nations glory when the finals get under way next June.
They will be joined in Cameroon by Cote d'Ivoire after they secured a 1-1 with already-qualified Guinea, Fulham midfielder Jean Michael Seri scoring the decisive goal that sees the Elephants progress from Group H.