Uruguay failed to progress to the World Cup round of 16 despite a 2-0 win over Ghana, who were left to rue Andre Ayew's early penalty miss.
La Celeste looked set to claim the second spot in Group H, but South Korea's late winner against Portugal saw them advance by virtue of scoring more goals than Diego Alonso's side.
In their first meeting since a controversial World Cup quarter-final in 2010, which saw Asamoah Gyan miss a penalty after Luis Suarez had been sent off for a handball on the goal-line, Ghana once again paid the price for a squandered spot-kick – this time Ayew failing to find the back of the net.
After a cagey beginning, Darwin Nunez nearly bundled his way through to goal after 12 minutes when set through by Giorgian De Arrascaeta, but Mohammed Salisu and Alidu Seidu recovered in time to steal the ball from under his feet.
Moments later, a bobbling strike from Jordan Ayew was spilled by Sergio Rochet and into the path of Mohammed Kudus, who was then brought to the ground by the Uruguayan goalkeeper. Andre Ayew had been blocking his view when the initial shot came in and so the offside flag was raised, but after a VAR review, he was judged onside and Ghana were awarded a penalty.
The Black Stars' forwards formed a circle around the penalty spot to prevent their Uruguay counterparts from scuffing it (Nunez still tried to and got booked for doing so), but Andre Ayew - part of the Ghana contingent of 2010 - missed, with Rochet atoning for his error and pushing the awful effort away.
Uruguay nearly went in front back down the other end when Nunez robbed Amartey of possession and dinked Lawrence Ati-Zigi, only for Salisu to retreat and clear the ball off the line.
And La Celeste did take the lead with their next attack. A cross from Nunez evaded Salisu and Seidu, finding a wide-open Luis Suarez. His scuffed shot was parried by Ati-Zigi, but De Arrascaeta ghosted in behind Salisu to nod the ball over the line.
They didn't have to wait too long to add their second, doubling their advantage just after the half-hour mark. Facundo Pellistri's high pass was flicked on by the head of Nunez and volleyed to the left by Suarez, where De Arrascaeta was waiting and volleyed beyond Ati-Zigi.
Otto Addo made two changes at half-time to try and change Ghana's fortunes, with substitute Osman Bukari firing wide shortly after taking to the pitch.
Uruguay were incensed that they didn't receive a penalty - even following an on-pitch VAR review - when Amartey clumsily went through Nunez to try and win the ball back.
Pellistri squandered a gilt-edged chance to add a third from around 12 yards out, finding only the side-netting, while a thunderous volley from Federico Valverde was punched clear by Ati-Zigi.
Ghana pushed for a late goal to try and save their campaign. Antoine Semenyo dragged a shot wide from a tight angle before Kudus had a searing strike tipped wide by Rochet.
With five minutes remaining, the mood in the stadium drastically changed as news filtered through that South Korea had taken the lead against Portugal, moving them above Uruguay in the standings on goals scored.
La Celeste went in search of another strike which would send them through and came close to finding one when Edinson Cavani's header was pushed over the top by the outstretched Ati-Zigi, who hurt himself making the save.
South Korea's win was confirmed as eight minutes of added time came into effect between Ghana and Uruguay, with the latter appealing for a penalty once more when Cavani was felled by Seidu. Again, their pleas fell on deaf ears.
Ati-Zigi denied a Maxi Gomez effort from range before Kamaldeen Sulemana forced another instinctive save out of Rochet in a frenzied period.
Sebastian Coates fired a cross from Cavani with the game's final chance and both sides were eliminated at the full-time whistle.