Kalidou Koulibaly scored a second-half winner as Senegal beat Ecuador 2-1 at the Khalifa International Stadium to finish second in Group A and book their place in the last 16 of the World Cup.
Watford forward Ismaila Sarr kept his cool to slot in a penalty spot just before half-time, but Brighton midfielder Moises Caicedo equalised in the 68th minute.
Senegal, though, were soon back in front when captain Koulibaly fired the ball home following a free-kick to send his side into the knockout stage – and a potential showdown with England.
Former West Ham and Everton striker Enner Valencia – scorer of three goals in the first two games – shook off an ankle problem to start for Ecuador, who would have qualified with a draw.
Senegal, the 2021 Africa Cup of Nations champions, had a great chance inside the opening two minutes when the ball ran through the penalty area to Idrissa Gueye, but the Everton midfielder dragged his shot wide.
Youssouf Sabaly then played Boulaye Dia into the right side of the box, but his low, angled shot went across the face of goal and past the far post before Sarr cut in from the left and curled a shot wide of the top corner.
Senegal, who beat hosts Qatar after losing their opening group match against the Netherlands, were awarded a penalty just before half-time when Piero Hincapie collided into Sarr.
The Hornets frontman got up to take the spot-kick himself and calmly rolled the ball past Ecuador goalkeeper Hernan Galindez.
Ecuador coach Gustavo Alfaro looked to make a positive change for the second half as he sent on both Jose Cifuentes and Brighton winger Jeremy Sarmiento.
After seeing lots more possession, Ecuador equalised in the 68th minute when Brighton midfielder Caicedo lashed the ball in from close range following a corner.
Senegal, though, were soon back in front from a set-piece of their own with 20 minutes left.
Chelsea defender Koulibaly arrived at the far post to fire home his first international goal when a deep free-kick had been knocked back across the six-yard box.
Ecuador went on the offensive again as Aliou Cisse’s men sat back to protect their lead.
While Ecuador pushed forward, they looked vulnerable on the counter, with Dia firing just wide as the Lions of Teranga held out for a memorable victory to reach the knockout stages of the World Cup for the first time in 20 years.
Why are you making commenting on The Herald only available to subscribers?
It should have been a safe space for informed debate, somewhere for readers to discuss issues around the biggest stories of the day, but all too often the below the line comments on most websites have become bogged down by off-topic discussions and abuse.
heraldscotland.com is tackling this problem by allowing only subscribers to comment.
We are doing this to improve the experience for our loyal readers and we believe it will reduce the ability of trolls and troublemakers, who occasionally find their way onto our site, to abuse our journalists and readers. We also hope it will help the comments section fulfil its promise as a part of Scotland's conversation with itself.
We are lucky at The Herald. We are read by an informed, educated readership who can add their knowledge and insights to our stories.
That is invaluable.
We are making the subscriber-only change to support our valued readers, who tell us they don't want the site cluttered up with irrelevant comments, untruths and abuse.
In the past, the journalist’s job was to collect and distribute information to the audience. Technology means that readers can shape a discussion. We look forward to hearing from you on heraldscotland.com
Comments & Moderation
Readers’ comments: You are personally liable for the content of any comments you upload to this website, so please act responsibly. We do not pre-moderate or monitor readers’ comments appearing on our websites, but we do post-moderate in response to complaints we receive or otherwise when a potential problem comes to our attention. You can make a complaint by using the ‘report this post’ link . We may then apply our discretion under the user terms to amend or delete comments.
Post moderation is undertaken full-time 9am-6pm on weekdays, and on a part-time basis outwith those hours.
Read the rules here