Gabriel Martinelli struck in the 95th minute to give Brazil a dramatic 2-1 victory over Japan on Tuesday in Houston.
It was a stunning turnaround that sent the Selecao into the next round. Japan had dominated much of the encounter but couldn't hold on.
Kaishu Sano had put the Asian side ahead in the 29th minute. He pounced on a loose Brazil pass and fired a low shot past goalkeeper Alisson Becker.
Brazil looked sluggish in that opening half. Coach Carlo Ancelotti made adjustments after the break.
Casemiro restored parity in the 56th minute. The midfielder rose highest to meet a cross from Gabriel Magalhães at the back post.
Neither team could break the deadlock as the match stretched toward its conclusion. Zion Suzuki made a crucial save to deny Vinicius Jr. late on.
Then came the heartbreak for Japan. Martinelli seized on a Bruno Guimaraes pass after Brazil intercepted possession near the Japanese goal.
According to him, he controlled the ball before slotting it into the bottom corner. Goalkeeper Suzuki got a hand to it but couldn't keep it out.
This marks the first time Brazil has scored a stoppage-time winner in World Cup knockout football. The achievement adds to their proud record.
Brazil's unbeaten run versus Asian nations in World Cups remains intact. Japan exits having lost all five of their knockout matches across various tournaments.
The Selecao have now reached the knockout stages in every World Cup since 1986. Their next opponent will be either Norway or Ivory Coast.
Martinelli's goal will be remembered as one of the tournament's defining moments. It's the kind of strike that defines World Cup dreams.