Houston. Brazil survived a World Cup last-32 scare after fighting back to beat Japan 2-1, with Gabriel Martinelli scoring a dramatic stoppage-time winner on Monday.
Brazil, who will next face Norway or Ivory Coast in New Jersey on Sunday, improved significantly after the break after Japan had taken an early lead and frustrated the five-time world champions for much of the first half.
Martinelli's winner in the 95th minute came at the end of a tense contest and was the latest winning goal scored in normal time in a World Cup knockout match since 1966. Brazil's players and coaching staff celebrated wildly on the pitch, while Japan's players watched in disbelief.
"I can't explain how I feel," Martinelli said. "It will only really sink in later. Thank God I managed to score the goal today. I'm so happy for the team, who gave everything."
Japan's Kaishu Sano stunned Brazil in the 29th minute when he intercepted a misplaced pass from Danilo before driving towards goal and firing past goalkeeper Alisson Becker.
Japan produced a disciplined defensive display in the first half, breaking up attacks and closing down space whenever Brazil had possession.
Brazil emerged after the interval with greater urgency and created a number of chances as they increased the tempo.
"We didn't lose our patience. We had a lot of resources on the pitch and on the bench," Brazil coach Carlo Ancelotti said. "Japan is not an easy opponent. It is very organised and intense.
"I was saving Neymar for extra time. He was going to come on in the 105th minute if we had not scored the second goal. I didn't want to change the structure because the team was playing well."
Brazil equalised in the 56th minute when Casemiro, who had missed a clear opportunity moments earlier, rose above his marker to head home a cross from Gabriel Magalhaes.
Vinicius Jr came close to putting Brazil ahead when his dazzling run ended with Japan goalkeeper Zion Suzuki producing a superb save to push his effort onto the post.
Japan held firm until Bruno Guimaraes received the ball on the edge of the area before slipping a pass through to Martinelli, who made no mistake with a clinical finish.
The result denied Japan a first-ever World Cup knockout victory, while Brazil remained on course to reach the quarter-finals, a stage they have reached in every tournament since their round-of-16 exit in 1990.