Saudi Arabia finished third in the group, winning their final match 2-1 against Egypt.
Heroes
Now 34, Ricardo Quaresma is nearing the end of his international career, but on his return to the starting eleven, he supplied an absolutely sublime moment for Portugal's goal.
Renowned for his ability to score with the outside of his prodigious right boot, the enigmatic front-man did it again, leaving Iran's goalkeeper Ali Beiranvand clutching at thin air as the ball flew past him into the top corner.
But Beiranvand himself enjoyed a special moment, too. He worked in a carwash, as a shepherd and a pizza delivery man before he became a professional footballer; today he saved a penalty from Cristiano Ronaldo.
And Iran and Morocco may both be going home, but they can do so with heads held high, earning arguably the most famous results in their respective histories.
Villain
Igor Smolnikov became the first outfield player from the World Cup host nation to be sent off since Marcel Desailly for France against Brazil in the 1998 final.
By the time he picked up his second yellow and was dismissed after 36 minutes, Russia were already 2-0 down and any chance of a revival effectively ended when they were reduced to ten men.
It was Smolnikov's first action of the tournament and could well be his last as he'll now miss the round-of-16 clash against Spain through suspension.
Stat chat
Uruguay became the first side to win all three of their group games without conceding a single goal since Argentina in 1998.
Morocco's goal against Spain was their first of the World Cup and came from their 29th attempt. It was also the fourth shot on target against Spain at the tournament, all of which resulted in goals.
There have already been 20 penalties awarded at the tournament, the most at any World Cup.
There have also been six own-goals at this World Cup, equalling the record set in France in 1998.
They said what?
Oscar Tabarez, Uruguay coach: "For me the holy grail of football is the word: balance. When we attack we need to be able to attack, but it doesn't come from an abstract suggestion. Whenever there is an attack it is because ball possession has been recovered or we have defended well on an opponent's attack. We work on balance all of the time."
Did you know?
Egyptian goalkeeper Essam El-Hadary today became the oldest ever World Cup player, at 45 years, 161 days.
Nicknamed the "High Dam", the veteran stopper's father, who has since passed away, told him it was his dream to watch his son play at a football World Cup.
El-Hadary marked the occasion with a penalty save, but ultimately couldn't prevent his side's third defeat of the tournament.
The playoff picture
The first round-of-16 clashes have been confirmed.
Uruguay will meet Portugal at 6am on Sunday and Spain will face Russia at 2am on Monday.
What's next?
The final pool games in Groups C and D are tomorrow morning.
France are already through in Group C and Denmark need just a point against the French at 2am to join them. If the Danes lose, Australia can progress if they beat already-eliminated Peru.
In Group D, Croatia have also confirmed their place in the last 16 but the underwhelming Argentina could miss out. Even if Lionel Messi's men beat Nigeria, they could still be pipped by Iceland if they can defeat Croatia.
Nigeria would advance with victory over Argentina with both Group D games underway at 6am.