After dominating the action for 90 minutes, but finding frustration from Costa Rica’s dogged defense and keeper Keylor Navas, Brazil finally broke through on a goal by Philippe Coutinho in the 91st minute, The New York Times reported.
Neymar added another goal in 97th minute for a 2-0 win.
Brazil controlled the whole game and led in shots, 23-4. But it could not score for 90 minutes, in part because of Costa Rica’s famous defense and Navas, and in part because of poor finishing.
With 10 minutes to play, it appeared that Brazil had won a penalty. But a video review judged that he had gone down a bit too easily, and it was reversed.
With 90 minutes gone, Brazil seemed in dire shape. Having drawn its opener, it was looking at two points from two games and a possible early exit from the Cup.
But Roberto Firmino headed a cross by Marcelo, and Gabriel Jesus made a beautiful little touch pass to an onrushing Coutinho, who smashed it in.
The goal deflated Costa Rica, and it seemed almost no surprise that a second went in before time, with Neymar punching it home.
The loss eliminates Costa Rica. Brazil has not clinched a berth in the second round, but probably only needs a draw against Serbia now, rather than a win.