In a match packed with controversy—Neymar was awarded a penalty that was then overturned by the video assistant referee—Brazil finally broke through in the 91st minute, as the Barcelona midfielder latched on to a loose ball in the penalty area and fired past Keylor Navas.
Neymar then added the gloss six minutes later and was clearly emotional amid the celebrations at the final whistle.
Following that dramatic Group E encounter, two fine goals from Ahmed Musa gave Nigeria their first win of the tournament against Iceland in Group D.
The day's play was wrapped up in style by Switzerland, as they recovered from a goal down to beat Serbia 2-1, with Xherdan Shaqiri scoring a winner in the final minute of the contes.t
Here's a recap of how the matches have panned out so far on Friday in Russia.
Brazil 2-0 Costa Rica
Nigeria 2-0 Iceland
Serbia 1-2 Switzerland
Belgium vs. Panama
Mexico vs. South Korea
Germany vs. Sweden
Brazil produced a gripping late show to start the day on Friday, as they finally broke down Costa Rica to pick up their first win of the tournament.
After a disappointing first half, the Selecao cranked up the pressure after the break, with Gabriel Jesus rattling the bar with a header. Then, Brazil thought they'd been given the perfect chance to break the deadlock when Neymar was deemed to have been held back and a penalty was awarded.
However, the referee opted to review the footage on the sidelines, and for the first time at the World Cup, VAR was used to overrule a penalty that had been given.
It was a call that split opinion:
Still, Brazil were able to keep their composure, and after some smart changes from manager Tite, they went ahead in the 91st minute.
Coutinho was the man in the right place at the right time, seizing a loose ball and prodding through Keylor Navas' legs.
He's in excellent form for Brazil:
Despite that last-gasp goal for the Barcelona man, it was still Neymar who finished the game in the spotlight.
The forward capitalised as Costa Rica surged forward late on, finishing into an empty net after a Fernandinho cutback. At the final whistle, he then sunk to the floor in floods of tears, showing just how much this one meant.
The second game of the day saw Nigeria eventually overcome Iceland, as Musa lit up the second period.
The forward was on had to score two excellent goals, the first a wonderful piece of control followed by a half volley and the second a composed finish at the end of a blistering run. OptaJoe put his goalscoring feats on the World Cup stage into context:
After his brace, Iceland could've set up a nervy finish when they were awarded a penalty. However, the usually cool Gylfi Sigurdsson fired over when aiming for the top corner.
The result represents a lifeline for Argentina after their 3-0 loss to Croatia on Thursday. If they beat Nigeria and better Iceland's result against Croatia, then they will progress:
Switzerland also appear on course to progress after they recovered against Serbia, thanks in the main to Shaqiri.
After goals from Aleksandar Mitrovic for Serbia and Granti Xhaka for the Swiss made the score 1-1, this one appeared to be destined for a draw. However, in the final stages, Serbia switched off to allow Shaqiri in on goal.
When in the position the Stoke City man kept his composure brilliantly, running away from the defender and poking past the onrushing Serbia goalkeeper.
With one game left to play in Group E, Switzerland, on four points, are in a fine position to progress, as they have an already-eliminated Costa Rica team to play. Brazil, on four points, and Serbia, on three points, will square off at the same time.