Brazil and Switzerland both progressed from Group E with the former going through as winners.
A 2-0 win over Serbia saw Brazil boast a slightly superior goal difference to that of Switzerland’s to top Group E at the World Cup.
Blerim Dzemaili opened the scoring in the 31st minute for the Swiss before Kendall Watson headed Costa Rica level 11 minutes into the second period.
Josip Drmic popped up with a late strike for Switzerland but a stoppage time penalty from Bryan Ruiz secured a 2-2 draw.
Meanwhile, at the Otkrytie Arena, goals from Paulinho and Thiago Silva in either half sealed all three points for Brazil to win the Group.
The Selecao will face Mexico in the round of 16 while Switzerland are set to play Sweden.