Senegal snatched Ecuador's place in the last 16 of the World Cup with a 2-1 win on the final matchday of Group A.
La Tri only needed one point to secure their passage to the knockout stages, while Lions of Teranga needed all three and showed the greater endeavour at the Khalifa International Stadium, deservedly setting up a clash with the winners of Group B.
Idrissa Gueye squandered a great chance to take a third-minute lead when an Ismail Jakobs cutback evaded several yellow shirts and fell kindly to the Everton man, but he could only find the side netting from just outside the six yard box.
Ecuador's dangerous defending gifted Boulaye Dia another huge opening soon after, beating the offside trap to meet a clever through ball from Youssouf Sabaly, but he dragged his shot agonisingly wide.
Ismaila Sarr was next to go close for the Lions of Teranga, sitting right-back Angelo Preciado on his backside and cutting onto his right foot, with his curling effort deflected just over the bar.
With half-time looming, Senegal were awarded a penalty when Sarr was bundled over by a reckless Piero Hincapie, with referee Clement Turpin immediately pointing to the spot. The Watford winger stepped up and picked out the bottom corner.
Ecuador boss Gustavo Alfaro made two changes at half-time to try and galvanise his side, but La Tri still looked flat and lacked the urgency they needed.
Against the run of play, Ecuador found their much-needed equaliser from a corner, with Moises Caicedo tapping in at the back post, peeling away from Ismail Jakobs for the easiest of finishes.
But almost immediately, Senegal re-took the lead down the other end. Idrissa Gueye's free-kick bounced off Pervis Estupinan and fell kindly for Kalidou Koulibaly to fire in from close range.
A half-volley from Gonzalo Plata went straight down Edouard Mendy's throat as Ecuador went in search of a second equaliser, while Boulaye Dia lashed one wide on the break at the other end.
Senegal rode out six minutes of stoppage time to advance to the knockout stages for the first time since 2002.
Ecuador vs Senegal player ratings, World Cup
1. Ecuador (4-3-3)
GK: Hernan Galindez - 5/10 - Bamboozled for the penalty and couldn't do a lot about Koulibaly's strike.
RB: Angelo Preciado - 4/10 - A constant liability down Ecuador's right.
CB: Felix Torres - 6/10 - Got a vital assist for Caicedo with his flick-on from the corner.
CB: Piero Hincapie - 3/10 - Such a needless foul to make for the penalty. Let his country down.
LB: Pervis Estupinan - 5/10 - Nowhere near as menacing as he was earlier in the group stage and Ecuador missed that.
CM: Carlos Gruezo - 4/10 - Contributed very little and was hooked at half-time.
CM: Alan Franco - 4/10 - Ditto. Ecuador didn't need passengers, let alone two in midfield.
CM: Moises Caicedo - 7/10 - The only midfielder up for the fight, scoring a needed equaliser.
RW: Gonzalo Plata - 4/10 - Didn't really show his promise until it was too late.
CF: Michael Estrada - 4/10 - Enjoyed some wins in early duels but faded very quickly.
LW: Enner Valencia - 4/10 - Similarly started brightly but couldn't maintain that pace.
SUB: Jeremy Sarmiento (46' for Franco) - 6/10
SUB: Jose Cifuentes (46' for Gruezo) - 5/10
SUB: Djorkaeff Reasco (64' for Estrada) - 5/10
SUB: Jackson Porozo (85' for Preciado) - N/A
Manager: Gustavo Alfaro - 3/10 - Ecuador were flat from the off and did not deserve to advance based on Monday's showing.
2. Senegal (4-2-3-1)
GK: Edouard Mendy - 6/10 - Didn't have a lot to do despite Ecuador's need to score.
RB: Youssouf Sabaly - 7/10 - Impressively got up and down the flank to Senegal's aid.
CB: Kalidou Koulibaly - 9/10 - A captain's performance at both ends, dragging his nation to victory.
CB: Abdou Diallo - 7/10 - Partnered Koulibaly well at the heart of the Senegal defence.
LB: Ismail Jakobs - 5/10 - Dragged back inside for Ecuador's equaliser. Was otherwise fine.
CM: Pathe Ciss - 6/10 - Didn't have to do a lot to win the midfield battle.
CM: Pape Gueye - 6/10 - Likewise completed the basics and that seemed to be enough.
RM: Iliman Ndiaye - 7/10 - Didn't give Estupinan much rest, constantly asking questions of the Brighton left-back.
AM: Idrissa Gueye - 6/10 - Pressed well in the hole despite naturally being a defensive midfielder. Suspended for the last 16.
LM: Ismaila Sarr - 8/10 - Like Ndiaye showed there's plenty of quality in the Championship, twisting and turning past Preciado.
CF: Boulaye Dia - 5/10 - Found it hard to get in the game. Most of Senegal's attacks came from wide areas.
SUB: Nampalys Mendy (74' for Ciss) - 6/10
SUB: Bamba Dieng (74' for Ndiaye) - 5/10
SUB: Pape Abou Cisse (90' for Dia) - N/A
Manager: Aliou Cisse - 8/10 - Senegal played with aggression and intensity from the off. They're great value for their place in the next round.