World Cup 2010 - Mexico and Uruguay progress
Luis Suarez scored the only goal of the game after 43 minutes as Uruguay topped Group A.
But Mexico also progressed to the last 16 courtesy of a superior goal difference to hosts South Africa, who beat France 2-1, and will face Group B table-toppers, probably Argentina, in the second round.
Both teams were certain of qualifying if they drew the encounter but any talk of a preordained stalemate was soon quashed after a lively opening.
Suarez capitalised on a mistake by Francisco Rodriguez but his shot drifted past the far post while Diego Forlan's corner was met by the stooping Mauricio Victorino but the unmarked defender was unable to keep his header down.
Alvaro Pereira then went clean through on goal only to screw his shot wide of the near post with Forlan screaming for a square pass.
Mexico did come close to breaking the deadlock when Andres Guardado unleashed a 35-yard thunderbolt which came off the underside of the crossbar and a vital saving tackle by Jorge Fucile denied Giovani Dos Santos just he was about to pull the trigger.
Uruguay did go ahead when a delicious cross from the right by Edinson Cavani was met by the unmarked Suarez who beat Oscar Perez at the near post with his close-range header.
With South Africa two up at the break, the large Mexican contingent had a nervous half-time, knowing that a further two goal swing would see them eliminated in the group phase for the first time since 1978.
They had more cause for concern after a superb save, diving low to his right, by Perez to push away Diego Lugano's header.
Manchester United new boy Javier Hernandez replaced veteran Cuauhtemoc Blanco midway through the second-half and immediately produced a superb pass to put Giovani through but again a superb saving tackle from Fucile denied him.
But Mexico should have been on level terms only for Rodriguez to conjure up one of the misses of the tournament.
Pablo Barrera curled a delightful cross from the right only for the defender to head wide when unmarked in the middle of the goal from six yards.
The game petered out in the final stages although Perez had to scramble across his goal to push Cavani's long-range dipper around the post.
Meanwhile Mexico, as runners-up, are likely faced with a rematch against Argentina, who ousted them in the last 16 in 2006.
Mexico v Uruguay
1st Half Goals 0-1
Shots on Target 1-5
Shots off Target 6-9
Blocked Shots 3-1
Yellow Cards 2-1
Red Cards 0-0
Passing Success 84.7%-72.7%
Tackles Success 83.3%-71.4%
Territorial Advantage 51%-49%