With South Korea placing second and joining them in the knockout rounds after a dramatic group stage finale, Portugal has defeated Group H of the World Cup in Qatar.
Portugal was already assured of a spot in the round of 16 after winning their first two games, so their 2-1 loss to South Korea didn't matter.
Ricardo Horta of Braga gave the Portuguese the lead before Kim Young-Gwon and Hwang Hee-Chan each scored goals in the 91st minute to seal South Korea's passage to the next round ahead of Uruguay on goals scored.
Before Hwang changed everything, the Uruguayans believed they were doing enough to advance to the round of 16, as they were defeating Ghana 2-0 and South Korea was being held by Portugal in the closing seconds.
The South American team had just one point going into Friday after losing to Portugal and drawing with South Korea. Even though they played better against Ghana, it wasn't enough.
Despite finishing with the same number of points and goal differential as Uruguay, South Korea advanced because of goals scored.
Ghana will be frustrated with how their campaign ended; having beaten South Korea, a draw with Uruguay would have been enough to see them through, but they fell to defeat.
Topping Group H rather than finishing runners-up was key in order to avoid the winners of Group G in the next round, which will most likely be Brazil, although that is yet to be confirmed.
Brazil go into their final group game against Cameroon just needing a point to guarantee top spot, while they could still finish top even if they are beaten.
Serbia, Switzerland, and Cameroon are all fighting to qualify for the last 16, with the Swiss in pole position with three points from two games, while Serbia and Cameroon have one each.