Portugal failed in their attempt to beat Brazil and climb above the World Cup heavyweights after a goalless Group G match in Durban.
Brazil clinched top spot while the Portuguese got the point they needed to finish second in the standings to also progress to the last 16 ahead of the Ivory Coast, who defeated North Korea.
The Brazilians will play the runners-up of Group H in their next game while Portugal will take on the winners from that pool.
Brazil almost went in front soon after the half hour mark. Luis Fabiano fed Nilmar at the far post and his five-yard shot was deflected by Eduardo's palm to the near post.
In the 38th minute, Luis Fabiano latched on to Maicon's cross from the right and his header went just wide of the near post.
Brazil goalkeeper Julio Cesar had one save to make in the opening half with Cristiano Ronaldo's 40th-minute strike not causing the Inter Milan man any problems.
Portugal came to life in the second half and Lucio was forced to make a crucial clearance from Ronaldo's cross with Danny waiting inside the area.
Before the hour mark, Raul Meireles struck just wide from five yards after a great run from Ronaldo.
In the 73rd minute, Dani Alves' 30-yard strike went wide while three minutes from time Lucio's header was saved by Eduardo.
Substitute Ramires almost earned Brazil victory but his right-footed strike was denied by an acrobatic save from Eduardo in stoppage time.