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 forced extra-time 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 either the United States – the 2015 winners – or Spain in Paris on Friday (20:00 BST).
It was heartbreak for Brazil, who had come back strongly after falling behind to force one of the tournament’s favourites to extra-time.
“I’m proud of our performance, the grit that we showed until the end,” said Marta, Brazil’s six-time world player of the year and scorer of a record 17 goals at World Cup finals.
“That’s the feeling that I will keep with me. Those are the kind of matches that will help women’s football to continue to grow.”
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.
They 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.