Gabriel Martinelli scored in the 95th minute as Brazil beat Japan 2-1 on Monday to reach the World Cup last 16, reports AFP.
Japan took the lead after 29 minutes when Kaishu Sano scored after a Brazil mistake.
Brazil equalised 11 minutes into the second half as Casemiro headed home from Gabriel's cross.
Martinelli, an Arsenal winger, scored the winner deep into injury time to seal victory.
Brazil, coached by Carlo Ancelotti, will face either Ivory Coast or Norway in New Jersey on Sunday.
A crowd of 68,777 watched the match in Houston.
Bd-pratidin English/ Jisan