Bruno Fernandes scored twice to give Portugal a 2-0 victory over Uruguay and send them into the knockout stages of the World Cup alongside France and Brazil.
Five-time champions Brazil and Cristiano Ronaldo's Portugal joined France in the World Cup knockout rounds with a game to spare on a dramatic day of action in Qatar.
Manchester United playmaker Bruno Fernandes starred for Portugal, which they won 2-0, scoring with a shot early in the second half before converting an injury-time penalty.
Ronaldo wheeled away in celebration after the first goal but FIFA decided he had not touched the ball, denying him a ninth World Cup goal, which would have put him level with Portuguese great Eusebio.
"It was a well-deserved victory," Portugal coach Fernando Santos said. "The first part is over, we are in a hurry. Now I will continue to work to improve what needs to improve."
Portugal topped Group H with six points after two matches, three ahead of Ghana, who edged a five-goal thriller against Son Heung-min's South Korea.
Man-of-the-match Mohammed Kudus, 22, one of the hottest properties in world football, caught the eye with two goals including the winner midway through the second half.
Portugal booked their place in the knockout phase in Qatar hours after Brazil progressed, courtesy of a late goal from Manchester United midfielder Casemiro.
The Brazilians, missing the craft of their injured talisman Neymar, looked as though they would have to settle for a point after a Vinicius Junior strike in the second half was disallowed for offside.
"The first aim was to qualify. That was really important in a group as difficult as ours," the 30-year-old Casemiro told Brazilian broadcaster SporTV.
Tite's Brazil kicked off their campaign in Qatar with a 2-0 victory over Serbia but Paris Saint-Germain forward Neymar limped off with an ankle injury.
Rigobert Song's team looked almost dead and buried after goals from Strahinja Pavlovic, Sergej Milinkovic-Savic and Aleksandar Mitrovic gave Serbia a two-goal cushion early in the second half.
But substitute Vincent Aboubakar and Eric Maxim Choupo-Moting snatched a draw with two quick-fire strikes just after the hour mark.
Switzerland have three points ahead of their final group game against Serbia, who are level on one point with Cameroon.