Senegal thumped five past 10-man Iraq and were later confirmed to be one of the World Cup's top eight third-place finishers for a place in the knockouts.
After both teams lost to France and Norway in their first two Group I matches, only a win - and by a significant margin - would be enough to keep hopes of progression alive. The Lions of Teranga understood the assignment and went on to record the biggest win by an African nation at a World Cup.
Iran's subsequent third-place finish in Group G on three points means Senegal go into the last-32 and, as it stands,
Pape Thiaw's side got off to a flyer in Toronto. They took the lead inside four minutes when Sunderland's Habib Diarra got the telling touch on Abdoulaye Seck's header and gained another advantage.
Rebin Sulaka pulled Sadio Mane to ground 20 yards out and was initially shown a yellow card. But referee Anthony Taylor went to the monitor and, after review, upgraded the card to a red on the basis Sulaka denied an obvious goalscoring opportunity.
Iraq's double blow made them only the second team in World Cup history to concede a goal and receive a red card inside the opening 15 minutes of a match, after Colombia vs Japan in 2018.
But they brought on Munaf Younus to return to full compliment at the back - and, aside from a Mane free-kick that was brilliantly pushed to safety by Basil, Senegal barely laid a glove for the rest of the half.
Iraq held firm for 10 minutes after the break, but substitute goalkeeper Jalal Hassan was then beaten twice in three minutes as Crystal Palace's Ismaila Sarr tapped in Lamine Camara's pull-back, before Pape Gueye curled in an absolute beauty a mere 89 seconds after his introduction.
Gueye helped himself to a thunderous second, which reached a top speed of 132km per hour, and shortly after Sadio Mane hit the bar with a looping effort, Everton's Iliman Ndiaye added the gloss with another cracker that left Hassan with no chance.
Your Site' Dan Long:
Senegal knew they needed to win big in Toronto in order to give themselves the best chance of reaching the knockout stages, but there was little sign of that happening when the half-time whistle was blown.
They were a goal and a man up on Iraq, but it was hard to tell with the way they struggled to test Graham Arnold's side, despite their obvious advantages.
Iraq's resolve was finally broken 10 minutes into the second half, though, and the game was done by the hour mark. Further brilliant strikes from Pape Gueye and Iliman Ndiaye just added the gloss.
What better way to enter the knockout stages than with such an emphatic win.
However, finishing third means, if they do qualify, they will face the winner of a group, so similar attacking intent would be of paramount importance.