Philippe Coutinho was the hero on Friday afternoon as his second goal of the tournament handed Brazil their first victory of the World Cup. They'd been on the front foot for much of the match, but it took until the 90th minute for the three points to finally be brought home with a close range toe poke. Costa Rica will feel hard done by, having largely defended well against Tite's men.
Brazil came into the game following a disappointing start to their tournament. A frustrating 1-1 draw with Switzerland saw Serbia two points ahead at the top of Group E, and a win against Costa Rica was paramount in their bid to progress into the last 16 in first place.
Meanwhile, Costa Rica arrived into St Petersburg having suffered at the hands of Aleksandr Kolarov's stunning free-kick. The 1-0 defeat to Serbia left them bottom of the pile in their group, and an unforeseen win over the Brazilians was desperately needed if there was to be any hope of remaining in the competition.
The match got off to a fairly even start - Brazil not showing the early signs of dominance like they had against Switzerland. In fact, the biggest talking point of the opening stages arrived when Casemiro weirdly waddled off the pitch before the cameramen panned up to his face - revealing the Real Madrid enforcer had suffered a nose bleed.
That was until the 12th minute. A Costa Rica counter attack saw Cristian Gamboa break forward before pulling a cross back to Celso Borges. The resulting shot should've been better executed from just inside the box. Instead, it drifted wide in a fantastic opportunity for the Costa Ricans.
25 minutes in, Gabriel Jesus had the ball in the back of the net, only for the goal to be ruled out as offside. As a deflected Marcelo shot came into the box, the Manchester City striker was the first to the ball. He looked offside, but the late flag from the assistant gave Brazil false hope as they all leapt to celebrate.
As the rest of the first half drew on, Brazil began to dominate. The 'disallowed' goal seemed to galvanise both fans and players as they began to turn on the style - looking particularly dangerous down the left wing with Neymar, Marcelo and Philippe Coutinho.
However, nothing came of it, and both sides went into the break even.
The second half kicked off at break neck pace, with Brazil coming excruciatingly close to taking the lead on three occasions by the 49th minute. Delightful one-touch football in the build up play pulled Costa Rica's defence apart. Each of Neymar, Paulinho and Coutinho had great opportunities to open the scoring, but nothing came to fruition.
Keylor Navas has come under a huge amount of criticism over the years, but the keeper proved some of the doubters wrong with a brilliant save in the 56th minute. A spectatular stop from the Costa Rican somehow tipped a fierce Neymar effort to keep his team in the game. Brazil certainly starting to hit fifth gear.
The best opportunity of the second half arguably came to Brazil's main man after 70 minutes. A defensive error found Neymar on the ball with acres of space on the edge of the box.
Trying to curl his effort around Keylor Navas, though, the 25-year-old knocked it just wide - most in the stadium were already celebrating. A huge chance. It seemed like a goal was never coming - that was until Neymar was pulled to ground in the Costa Rica box - the referee not hesitating to give a spot kick.
However, the winger made a lot of it, and the referee did review the claim under VAR. The second opinion arrived only seconds later, and Neymar was adjudged to have dived. Frustration for Brazil, and a sigh of relief for Costa Rica.
It wasn't until the 90th minute until the scoring was finally opened. They thoroughly deserved the winner, but it took for Coutinho to poke home a close range effort between the legs of Keylor Navas right at the death to make the score 1-0.
And then, six minutes later, the win was confirmed when Neymar tapped home into an empty, finally getting the goal he had spent the entire match searching for; doubling Brazil's lead.
Harsh on Navas, who has done everything he could to keep the scores level, and had put in one hell of a shift, but Brazil's late victory was very well earned.