Christopher Wooh scored the winner in added time as Cameroon came from behind to defeat Gambia 3-2 in their final AFCON group stage match on Monday.
The young defender netted in the first minute of added time to earn the Indomitable Lions of Cameroon their first win at AFCON and with it, qualification to the knockout stage, Cameroon's 16th in their AFCON history.
Cameroon finish in second place in Group C with four points and will face perennial rivals Nigeria in the round of 16 fixture.
All five goals came in the second half as Karl Toko Ekambi put them ahead ten minutes after the interval before two goals from Gambia turned the game on its head. An own goal restored parity before Wooh delivered the face-saving goals that sees Rigobert Song's side squeeze through the group stage.
Gambia scored moments later but VAR intervention cancelled the goal scored using the hand as five-time AFCON winners Cameroon resumed their celebrations at the end of the enthralling encounter.
They finished behind defending champions Senegal who defeated Guinea 2-0 to finish the group stage with the maximum nine points and the favourites await their knockout opponent.
Guinea, on the other hand, qualify as one of four best loser nations in third place due to inferior goals difference to Cameroon as both nations finished with four points apiece.
Cameroon will face Nigeria at the Felix Houphouet-Boigny stadium on Saturday, 27 January.