A second-half brace from Fred helped Brazil down Italy, 4-2, on Saturday to clinch the top spot in Group A at the Confederations Cup.
Italy also advances to the semifinals of the competition despite the defeat, but the Italians will likely face Spain in their next match on Thursday, while Brazil will play Wednesday in the other semifinal against the second-place team from Group B.
Dante came off the bench to replace the injured David Luiz midway through the first half, and the Bayern Munich man scored the opening goal in first-half stoppage time when he scored on the rebound from Fred's header.
It was Dante's first international goal, but early in the second half, Italy equalized after a clever flick from Mario Balotelli released Emanuele Giaccherini into the penalty area on the right, and he beat goalkeeper Julio Cesar with a shot that settled inside the far post.
Neymar scored a goal in each of Brazil's first two games, and he found the net again four minutes later when he drew a foul near the edge of the box and curled the subsequent free kick around the wall and inside the right post.
Fred made it 3-1 to Brazil in the 66th minute when he brought down Marcelo's long ball and held off a defender before lashing his shot past goalkeeper Gianluigi Buffon, although Italy came back five minutes later through Giorgio Chiellini.
Italy was still down a goal with 10 minutes to play and came within inches of equalizing when Christian Maggio's header rattled the crossbar.
But Fred secured the win a few minutes from time when he was on hand to follow up Marcelo's saved shot, giving Brazil a perfect three wins from three games in group play.
The other match in Group A saw Mexico claim a 2-1 win over Japan with Javier Hernandez scoring both goals for El Tri in the second half before the Japanese pulled one back through Shinji Okazaki four minutes from time.