Brazil defeated Serbia by a 2-0 margin at the Spartak Stadium in Moscow, to claim top spot in Group E and set up a Round of 16 clash with Mexico.
Things didn't start well for the South American champions as they lost Marcelo through injury in the eight minute of the match, forcing coach Tite to replace him with Filipe Luis. Neymar however, would take to the task ahead, hitting a firm shot from just inside the box in the 25th minute, which Vladimir Stojkovic proved equal to the task with a good save.
Four minutes later Gabriel Jesus also came close, heading over from close range. But Paulinho would the nerves of Brazilian fans when in the 36th minute, he raced unto a ball flicked by Philippe Coutinho over Serbia's backline and lobbed the advancing Stojkovic.
Serbia came to life in the second half and created several great opportunities during a spell of intense pressure. Alisson had to come up big on several occasions, including a brilliant one-handed save in the 61st minute off an Aleksandar Mitrovic that had goal written all over it. The Serbs continued to press and could have easily erased the two-goal deficit, but shot wide after having some good look-ins.
However, Brazil made their opponents pay for not putting away their earlier chances. Neymar deliver a left side corner in the 68th minute and defender Thiago Silva, who came up for the set piece, would ran and meet the ball with a perfectly placed header to beat Stojkovic at the near post.
The second goal took some of the fight out of Serbia and Neymar would go close on two occasions, one where his shot bounced into the ground and over the crossbar after Willian did extremely good work on the right to pick him out in front of goal.
Serbia, who won some fans from their enterprising play, exited the tournament on three points.
In the other Group E contest, Costa Rica denied Switzerland the chance of topping the group when they held them to a 2-2 draw.
Playing for just pride after losing their opening two matches, the Costa Ricans produced their best turnout at the tournament by taking the game to their European rivals. In the 20th minute striker Joel Campbell unleashed a powerful shot from the edge of the box, but Yann Sommer did well to push the ball behind for a corner.
And in the 31st minute, against the run of play, Breel Embolo knocked down a right side cross with his head for Blerim Dzemaili to fire into the back of the net past Keylor Navas, to give Switzerland the lead.
Costa Rica continued to pressure their opponents and it paid off in the 56th minute when Kendall Waston rose above the defence to meet campbell's right side corner with a firm header that flew to the right of Sommer.
In a game of changing fortunes, Switzerland took the lead again with just two minutes of regulation left on the clock. After racing up the right flank, Denis Zakaria caught the Costa Rican defence tracking back, and he whipped a cross over to Josip Drmic who was not picked up by anyone. Drmic ran onto the ball and blasted home from the middle of the box. But it was not to be the last goal of the match as referee Clement Turpin awarded a penalty to Costa Rica after Campbell was upended, though the foul appeared to have taken place just outside the box. Bryan Ruiz took the spot kick and his shot struck the underside of the crossbar and struck Sommer on his back before entering the net.
The draw saw the Swiss finish their group assignment on five points, earning them a Round of 16 clash with Sweden.