Qatar became the first World Cup hosts to be dumped out of the tournament after just two games, as Senegal secured a morale-boosting victory in Doha.
Mohammed Muntari made history as the first Qatari player to score at the World Cup, but it wasn't enough as Senegal's class told in the end.
After suffering 2-0 defeats in their opening games, both teams faced a virtually do-or-die situation at Al Thumama Stadium.
But you wouldn't have known it judging by the early exchanges, with Senegal dominating but failing to carve open the Qatari defence in a fairly sedate opening.
But then Boulaye Dia pounced on a horrible error from Qatar centre-back Boualem Khouki who, attempting to clear in his own box, slipped and allowed the Senegal striker to bury it from 12 yards.
Senegal doubled their lead straight after half-time, as former Bristol City striker Famara Diedhiou rose highest to power home a wonderful header.
That left Felix Sanchez's side with it all to do, their tournament hopes hanging by a thread. In fairness, they exhibited some much-improved attacking play, with Edouard Mendy saving smartly from Almoez Ali and Ismaeel Mohammad in the second half.
Ghana-born forward Muntari then wrote himself in Qatari folklore by scoring their first World Cup goal, a fine 78th minute header that might have set up a thrilling finale – had it not been for Senegal sub Dieng. He arrowed home on 84 minutes to wrap up the African side's victory.
A draw between the Netherlands and Ecuador later in the day confirmed Qatar as the earliest-ever team knocked out of the World Cup while hosting the tournament.