Kalidou Koulibaly's nerveless volley sent Senegal into the World Cup's knockout stages for only the second time in their history as they eliminated Ecuador at a rowdy Khalifa International Stadium.
The win means Aliou Cisse's side finish second in Group A, setting up a last-16 meeting with Group B winners England on Sunday (19:00 GMT).
All three goals came from players based in England as Ecuador's Brighton midfielder Moises Caicedo cancelled out a penalty by Watford's Ismaila Sarr before Chelsea defender Koulibaly's side-footer won it.
Ecuador needed just a point to progress but paid the price for a passive display as Senegal were spurred on by an almost non-stop cacophony of drumming from their supporters in Al Rayyan.
Watford winger Sarr coolly stroked home from the spot, after being clumsily upended by Ecuador defender Piero Hincapie, to put the African champions deservedly ahead.
Ecuador levelled with their first real chance as Caicedo swept home Felix Torres' flick-on but Koulibaly's composed finish immediately regained the lead for Senegal, who knew only victory would be enough to go through barring an unlikely Qatar upset against the Netherlands.
They held out amid a nervy six minutes of stoppage time to finish as runners-up in the group behind the Dutch, who clinched top spot by handing the tournament hosts a third defeat in three games with a comfortable 2-0 win in Al Khor.