Dominant Brazil needed stoppage time to find a way past Costa Rican backstop Keylor Navas and pick up a 2-0 win in Saint Petersburg on Friday.
Neymar embarrassingly saw an awarded penalty overturned when he flopped instead of shooting following a tug from Giancarlo Gonzalez, but Philippe Coutinho toe-poked a shot through Navas’ legs in the first of six stoppage time minutes.
Neymar would later add a goal in the sixth minute of stoppage time from Douglas Costa.
Brazil finishes the group stage with Serbia, while Costa Rica waits on Switzerland.
[ MORE: Latest 2018 World Cup news ]
Brazil controlled the first 12 minutes of the match, but Costa Rica just missed a bid to make it 1-0 against the run of play.
Deportivo La Coruña midfielder Celso Borges darted into the box to drag a low shot just wide of the far post.
Gabriel Jesus had the ball in the back of the goal in the 26th minute, but was deemed offside. And Keylor Navas stymied another Brazil rush a minute later.
But Costa Rica’s packed-in camp held Brazil at bay into the break.
[ LIVE: World Cup scores ]
Brazil fired out of the gates to start the second half, and Navas was again busy as Neymar clattered into him in search of a loose ball. Well, kinda loose.
When Philippe Coutinho’s hammered shot was blocked out for a corner, it simultaneously felt like Brazil’s goal was either inevitable or destined to not arrive.
Navas then pushed a Neymar point-blank bid over the bar.
Tite opted to bring on Roberto Firmino, but Navas kept up his heroics by collecting a header off another Brazil corner.
The possibility of a scoreless draw felt even more likely when Neymar stole the ball and whipped a 21-yard shot just off the upper 90.
Neymar looked to have a won a penalty kick when Gonzalez tugged him in the six, but VAR overturned the call.