(CNN) -- Brazil and Portugal played out a disappointing draw as Group G reached its climax but both cruised into the last 16 of the World Cup.
Striker Nilmar came the closest to breaking the deadlock for Brazil, as his shot was diverted onto the crossbar by Portugal goalkeeper Eduardo.
Brazil finish as group winners and will face either Spain, Chile or Switzerland in the second round. Portugal go through as runners up and will face either Spain or Chile.
Ivory Coast comfortably beat North Korea 3-0 in the group's other match but it wasn't enough to give them hope of qualifying in place of Portugal.
Brazil 0-0 Portugal
During a cagey opening in Durban, neither side created any chances of note in the opening 20 minutes of the game, that was dominated by a series of niggly fouls.
Brazil defender Juan was lucky not to see a red card as he hand balled a long pass that would have released Cristiano Ronaldo.
The first real chance came on the half hour mark as Nilmar met striker Luis Fabiano's cross but Portugal goalkeeper Eduardo turned his effort onto the crossbar.
Fabiano then headed narrowly wide of the target as he met Maicon's cross from the right flank.
Ronaldo registered Portugal's first effort on target five minutes before the break but his powerful shot was easily gathered by Brazil goalkeeper Cesar.
A series of fouls disrupted the flow of the game, as the referee produced seven yellow cards before half-time arrived -- including one to Tiago for diving.
Fabiano forced Eduardo into another save with a looping header before Simao tested Cesar at the other end but his shot was right at the 'keeper.
A powerful run from Ronaldo created a chance for Raul Meireles but his flick towards goal brushed the side-netting via a touch from Cesar.
Substitute Ramires brought a superb save out of Eduardo near the end as his shot was deflected towards the top corner but both sides were content to hold out for a point.
Ivory Coast 3-0 North Korea
Ivory Coast knew they needed to rack up as many goals as possible against North Korea to have any chance of qualifying and they opened the scoring within 15 minutes.
Yaya Toure collected Arthur Boka's cross before stroking the ball into the far corner. Just a minute later, full-back Romaric hit the post.
In the 20th minute striker Didier Drogba smashed a shot against the crossbar before Romaric nodded the rebound into the net.
Gervinho nearly made it 3-0 seven minutes before half-time but his shot from an angle flicked off the outside of the post.
Drogba came close to adding a third after the break but his diving header flew over the crossbar before substitute Salomon Kalou smashed a shot over the bar from close range.
With ten minutes remaining Kalou met Boka's cross to fire into the net and despite having two goals disallowed for offside, the Ivory Coast couldn't add to their tally.