A goal each from both Philippe Coutinho and Neymar bailed Brazil out with stoppage-time strikes against Costa Rica following another uninspiring display at the 2018 World Cup.
Coach Tite’s team were heading for a second successive inglorious draw when Barcelona midfielder Coutinho popped up to poke home from Roberto Firmino’s nod down.
And with seconds remaining Neymar, the world’s most expensive player, tapped in Douglas Costa’s cross to secure Brazil’s first win of the tournament.
Their hopes of victory looked to have been dashed when they had a penalty decision overturned by VAR in the 78th minute after referee Bjorn Kuipers had initially ruled Neymar had been brought down in the area.
Although Brazil currently lead Group E, the team would need at least a draw in their final pool match against Serbia to go through.