Saudi Arabia snatched a 2-1 win over Egypt in the final game in Group A, gifting the Green Falcons their first World Cup win since 1994.
This match was the first time that these two sides have faced up against each other since 1999, where Saudi Arabia secured a 5-1 win over Egypt in the Confederations Cup. This was also the Pharaohs' first match against Asain opponents at a World Cup finals.
Mohamed Salah opened the scoring with a stunning dink over the goalkeeper but Saudi Arabia snatched one back with a penalty just before the break. Both sides pushed for a winner late on and Salem Al-Dawsari scored with the last kick of the game to deny Egypt their first ever win at the World Cup.
Egypt talisman Mohamed Salah started the game brightly and was a threat down the right-hand side of the pitch, with Saudi Arabia defender Yasser Al-Shahrani caught too far up the pitch in the opening encounters.
Salem Al-Dawsari then tried his luck from distance on two occasions but he was unable to force Egypt's 45-year-old goalkeeper, Essam El-Hadary, into action.
But Saudi Arabia were made to pay for their indecisiveness in front of goal when a looping pass from Abdallah Said was met by the onrushing Salah. The Liverpool talisman took a delightful touch to cushion the ball before chipping the onrushing goalkeeper to put Egypt into the lead.
Midfielder Salman Al-Faraj missed the chance to register Saudi Arabia's first goal at the World Cup with a weak effort from the edge of the box, but the Green Falcons were fortunate to be awarded a penalty five minutes late.
Saudi talisman Fahad Al-Muwallad stepped up and fired the spot-kick towards the bottom left corner of the goal, but veteran 'keeper El-Hadary got a strong palm to the shot which directed the ball onto the woodwork before it was cleared away from danger.
A long VAR check just before the break saw Saudi Arabia given another chance to score from the penalty spot for a slight tug on Al-Muwallad's shirt. This time Al-Faraj stepped up and made no mistake from 12 yards.
Things quietened down after the restart but Saudi Arabia did look for a third penalty minutes into the second half - referee Wilmar Roldán waved away the hopeful appeals. Hattan Bahebri then saw a close-range effort sail over the crossbar.
Mahmoud Hassan, otherwise known as Trézéguet, continued to threaten with a powerful header on a rare venture forward for Egypt at the start of the second half.
Saudi midfielder Housain Al-Moqahwi tried his luck with a few shots but he was kept at bay by Egypt goalkeeper Essam El-Hadary, while Mohamed Elneny was equally unsuccessful from long-range moments later.
Both sides jousted for a second goal and although neither of the two goalkeepers were really troubled in the closing stages of the game, Salem Al-Dawsari popped up with a clever finish to snatch the points away from Egypt with the last kick of the game.