AP PHOTOS: Brazil leaves it late on Day 9 of World Cup
Philippe Coutinho struck in the first minute of added time, and Neymar followed six minutes later. Costa Rica was eliminated from the tournament.
Switzerland came back from an early goal down to beat Serbia 2-1 in a politically-charged match because of tensions over some Swiss players with ethnic Albanian heritage. It was the first come-from-behind victory of this edition of the tournament and leaves Switzerland, Serbia and Brazil fighting to advance from Group E.