Senegal overcame Equatorial Guinea to set up an Africa Cup of Nations semi-final against Burkina Faso.
Ex-Bristol City forward Famara Diedhiou put Senegal ahead with a first-time strike following Sadio Mane’s pass.
Equatorial Guinea were awarded a penalty before the decision was overturned, but then equalised soon after through Jannick Buyla’s low shot.
But substitute Cheikhou Kouyate volleyed Senegal ahead, with Watford’s Ismaila Sarr side-footing a late third.
Senegal, who never have won the tournament, face Burkina Faso on Wednesday, before Egypt play Cameroon in the second semi-final on Thursday, with the final taking place on Sunday, 6 February.
Equatorial Guinea, 114th in Fifa’s world rankings, had been hoping to cause an upset against a Senegal side ranked 20th – the highest-placed African nation.
Senegal started well as Idrissa Gueye fired a free-kick wide and Diedhiou had a shot saved by Jesus Owono before their 28th-minute opener.
Liverpool forward Mane, taken to hospital with concussion after suffering a clash of heads in the last-16 match against Cape Verde, played an excellent pass and Diedhiou finished well.
But Equatorial Guinea, semi-finalists in 2015, fought back early in the second half.
They thought they had a penalty when referee Victor Gomes pointed to the spot after the ball hit Kalidou Koulibaly’s hand at close range. But, following a VAR intervention, Gomes watched the incident on a pitchside monitor and judged Koulibaly could not have moved away in time as it was so close.
Equatorial Guinea bounced back from that disappointment and equalised in the 57th minute as Pablo Ganet linked up with Buyla, who fired an angled strike past Chelsea goalkeeper Edouard Mendy.
But Senegal were gifted a 68th-minute second when Crystal Palace midfielder Kouyate, brought on just three minutes earlier, volleyed into the net after two Equatorial Guinea defenders collided into each other while trying to head clear.
Another substitute Sarr, playing his first game since November after injury, sealed Senegal’s victory after good work from team-mate Saliou Ciss.