Brazil finished top of the section with seven points with Portugal in second place on five. Ivory Coast beat North Korea 3-0 in the other game in Nelspruit but it was not enough. [break]
The match, one of the most eagerly-awaited of the first round, was a huge disappointment with neither team prepared to take risks and was marred by petulant behavior on both sides.
"It was a difficult game. They started very strongly, we had to put on our working overalls but I think we left the match wearing a smoking jacket," said Portugal coach Carlos Queiroz.
"There was a fantastic attitude from all the Portugal players. They were great in how they tried to play their football and how they fought," he added.
Brazil captain Lucio, asked about the many fouls, added: "We know both teams had a lot of will to win and went in with a lot of determination and so it happens, one or more severe tackles.
"I think our team tried to play a little more. We knew it would be like that as both teams were qualified."
THREE CHANGES
Portugal, needing a point to make absolutely sure of a place in the last 16, made three changes from the team that thrashed North Korea 7-0 in their last group match.
Defenders Duda and Ricardo Costa were brought into the starting eleven along with forward Danny, replacing Pedro Mendes, Hugo Almeida and Simao Sabrosa.
Brazil replaced Robinho with Nilmar in their lineup while Julio Baptista stood in for the suspended Kaka in midfield.

The flurry of bookings in a bad-tempered first period included Brazil midfielder Felipe Melo, hauled off just before halftime by coach Dunga and replaced by Josue as his duel with Pepe -- also yellow carded -- threatened to boil over.
There were only three efforts on target before the break as both teams canceled each other out.
The best first-half chances fell to Nilmar, who had his close-range effort tipped onto the post by Eduardo after a cross by Maicon and then saw a downward header from another Maicon cross bounce just wide of the goal.
Tempers calmed down after the break with Portugal looking the sharper and substitute Simao Sabrosa forced Brazil goalkeeper Julio Cesar to make a tricky save from a long-range effort at the second attempt.
Portugal should have gone ahead soon after when Cristiano Ronaldo´s run ended with the ball falling to Raul Meireles but his close-range effort was saved by Cesar who dived bravely to turn the ball around the post and was hurt in the process.
Brazil were without suspended playmaker Kaka and forward Robinho, who was rested as the five-times world champions were already sure of their place in the last 16.
Ivory Coast beat North Korea 3-0 but bow out
Ivory Coast bowed out of the World Cup on Friday with a 3-0 victory over North Korea which was too little, too late for their chances of making it into the last 16.
The African team, needing a huge win to give themselves any hope of reaching the second round, grabbed two early goals in the Group G game.
Yaya Toure scored the first in the 14th minute, side-footing neatly home from the edge of the box, and Ndri Romaric notched the second six minutes later after a Didier Drogba shot bounced back off the bar.
Salomon Kalou added a third in the 82nd minute but the Koreans did not cave in as they did in losing 7-0 to Portugal and the result was not enough for Ivory Coast to prevent Brazil and Portugal going through as top teams in the group.
Forest fire kills 62 in Portugal; search on for more bodies