Defending champions Senegal secured top spot in Group C at the 2023 Africa Cup of Nations after beating Guinea 2-0 in an ill-tempered encounter.
Abdoulaye Seck headed the Teranga Lions in front from a free-kick and Iliman Ndiaye sealed victory with a fine low finish in the final minute.
Guinea knew they would go through before kick-off and finished third after Cameroon beat The Gambia 3-2.
Senegal progress from the group stage as the only side with a 100% record.
Aliou Cisse’s side will stay in Yamoussoukro and face a third-placed side from Group A or F in the last 16 on Monday, while Guinea will play Group A winners Equatorial Guinea on Sunday in Abidjan.
The Syli National finished third behind Cameroon on goals scored, with their four-point tally meaning four-time continental champions Ghana were eliminated from the finals after the Black Stars ended third in Group B on two points.
Results on Monday meant Guinea were guaranteed to go through as one of four best third-placed sides at the very least, and boss Kaba Diawara made several changes to rest players for the knockout stages.
Both sides were fired up for this West African derby, but there was not a single shot on target in the first half as the teams struggled to create openings.
An early challenge from Senegal midfielder Nampalys Mendy on Guinea’s Ilaix Moriba sparked an argument between players, and the first real chance of the game came when a thunderous shot from Mendy was diverted over the bar off the head off Mohamed Ali Camara.
Guinea employed a physical approach but could not provide service to star striker Serhou Guirassy, who was making his first appearance at the tournament following injury and could not get the better of Senegal captain Kalidou Koulibaly.
The holders appealed for a penalty on the stroke of half-time as star forward Sadio Mane fell to the ground following a duel with Saidou Sow, but referee Pacifique Ndabihawenimana waved play on.
The Burundian official did have work to do in first-half injury time when Ismail Jakobs sparked a mass confrontation which involved both sets of substitutes benches after the Senegal left-back shoved Guinea captain Naby Keita to the ground.