Belgium booked their place in the World Cup last 32 as Group G winners after thrashing New Zealand 5-1, while Egypt joined them in the knockout phase following a 1-1 draw with Iran.
Egypt finished second on goal difference after securing the first World Cup knockout-stage berth in their history. Iran were left third with three points after a stoppage-time winner was ruled out by VAR, but retain hope of advancing as one of the best third-placed teams.
Iran were deprived of a certain place in the World Cup knockout phase when a goal in stoppage time that would have given them a 2-1 win against Egypt was disallowed.
Shoja Khalilzadeh thought he had scored the crucial winning goal as he slammed into the net after Egyptian defenders failed to clear, but Iranian celebrations were cut short after VAR deemed there was offside.
The final whistle sounded soon afterwards, leaving white-shirted Iranian players sprawled on the turf in disbelief.
With three points, Iran retain hope of qualifying as one of the eight best third-placed teams.
Mehdi Taremi had also hit the bar with a header for Iran in the closing minutes of normal time.
The Egyptians having learned before the game that they were qualified for the last 32 for the first time in their history due to results elsewhere but that took nothing away from a ferocious game in Seattle.
The Pharoahs raced into the lead in the fifth minute when Mahmoud Saber stroked home.
Iran fought back and had a golden chance to level five minutes later when Taremi won, but subsequently missed, a penalty.
Within minutes, Ramin Rezaeian scored from a tight angle to bring the teams level.
Manchester City forward Omar Marmoush came on for the second half to inject some fresh impetus into the Egyptian attack.
He made an impact midway through the second half when his curling goalbound shot was deflected for a corner.
Mohamed Salah was removed in the 57th minute, looking decidedly unhappy as he exited to make way for Zizo but the former Liverpool legend will no doubt have a role to play when Egypt face Australia in the next round.
Belgium defeated New Zealand 5-1 to book their place in the knockout rounds of the World Cup on Friday, securing their first win of the tournament to finish on top of Group G in Vancouver.
A double strike from Arsenal's Leandro Trossard and goals from Kevin De Bruyne, Romelu Lukaku and Alexis Saelemaekers carried the Red Devils into the last 32 in first place ahead of Egypt on goal difference.
Belgium dominated a lopsided first half and had alarm bells ringing in the New Zealand defence early on when Trossard's angled shot cannoned off the inside of the upright only to be cleared off the line by Tyler Binden.
The Red Devils looked poised to take the lead moments later when Jordanian referee Adham Mohammad pointed to the penalty spot after Trossard's shot hit the arm of covering defender Finn Surman.
But VAR sent Mohammad to the monitor to take another look at the decision, which was subsequently overturned and New Zealand breathed again.
Yet Belgium did not have long to wait before the breakthrough and again it was Trossard who proved to be in the right place at the right time, bundling home from close range after De Bruyne's corner sowed panic in the six-yard box.
Trossard effectively made the game safe five minutes into the second half, controlling a rebound in a crowded area to volley home past New Zealand goalkeeper Max Crocombe at the near post.
De Bruyne then stroked home an elegant low finish in the 66th minute to make it 3-0, a crucial goal which saw the Belgians leapfrog over Egypt into first place on goal difference.
Yet there was to be a dramatic end when New Zealand's Elijah Just volleyed home a consolation strike from the edge of the area to make it 3-1.
That could have been potentially costly, with the goal suddenly bumping Belgium down into second place.
But Lukaku nodded home his team's fourth in the 86th minute with his first touch just a minute after coming on as a substitute to return Belgium to the top of the table.
Saelemaekers completed the scoring with a shot from the edge of the area.