Hosts France beat Brazil 2-1 to reach the Women’s World Cup quarter-finals in another game dominated by video assistant referee decisions.
Valerie Gauvin, who had earlier had a goal ruled out by VAR, put France ahead after a fine run by Kadidiatou Diani.
Brazil levelled when Thaisa’s drive, originally ruled out for offside, was given after another VAR check in Le Havre.
Amandine Henry got on the end of Amel Majri’s long free-kick for the winner.
A tightly contested tie was minutes away from a penalty shootout when France captain Henry scored from close range to send Les Bleues into the last eight and a tie with the United States – the 2015 winners – or Spain in Paris on Friday.
It was heartbreak for Brazil, who had come back strongly after falling behind to force one of the tournament’s favourites to extra-time.
Having finished behind Italy and Australia in Group C, the South Americans advanced to the knockout stage as one of the best third-placed teams.
Despite giving France a major scare, this was the end of the road for the 2007 runners-up even though the hosts again struggled to hit top form at Stade Oceane.
Corinne Diacre’s side did not register a shot on target in their previous match against Nigeria until the 65th minute.
Against Brazil, they failed to manage a shot on target in the first half after Gauvin’s 23rd-minute header was ruled out after a lengthy VAR review.