France finished top of Group A after a twice-taken penalty by Wendie Renard gave them victory over Nigeria in an incident-packed Women's World Cup game.
The initial penalty - awarded after a video assistant referee review for a foul on Viviane Asseyi - hit the post.
But keeper Chiamaka Nnadozie was ruled to have moved off her line early and Renard slotted the re-taken spot kick.
Despite losing 1-0, Nigeria still have a big chance of making the last 16 as one of the best third-placed teams.
Group winners France, meanwhile, head to Le Havre to meet as yet unknown opponents on June 23.
This was an unconvincing display by Corinne Diacre's side against a team ranked 38th in the world, with France guilty of wasteful finishing before the late drama in Rennes.
Meanwhile, Germany punished an error-strewn display from South Africa to finish top of Group B at the Women's World Cup.
The two-time winners had ample chances to win by more than 4-0 against debutants Banyana Banyana, who leave France having failed to earn a point.
Melanie Leupolz headed in the opener, then an awful error by keeper Andile Dlamini gifted Sara Dabritz a tap-in.
Wolfsburg's Alexandra Popp nodded in a third before the break and Lina Magull added another from a yard out.
NIGERIA, FRANCE PERFORMANCE
France boss was full of praise for Renard, saying: "I'd like to commend the courage Wendie showed.
"She had that tenacity to go back to the penalty spot and take that kick."
Nigeria boss Thomas Dennerby described his players as "heroes" before, when asked about the twice-taken penalty, adding: "If I give you my honest feelings, they'll probably send me home so it's better I don't say anything.
"Of course I'm disappointed by the result, France is a really good team and don't need support from anybody to win games.
"The girls were fighting so well, they followed the match plan and it's getting destroyed by people that we're not so happy with."
Nigeria, who had produced a gritty defensive performance, were on course for a deserved point when a penalty was awarded after a VAR check following Ngozi Ebere's foul on Asseyi.
Ebere, who had been booked in the first half, was sent off for a second yellow card before Renard's first penalty hit a post. However, the officials adjudged 18-year-old Nnadozie had left her line early and Renard duly scored from the second attempt.
It continued Renard's eventful World Cup - the Lyon player now has three goals at this tournament in addition to scoring a calamitous own goal.
"When it came to it, the players were asking me whether I wanted to take another go at it, and I decided I was going to take the penalty again," said Renard.
"It was very good for the team, and also for me as well."
From 1 June, new laws came into force, including one that states the keeper must have one foot partly on the goal line (or above it if jumping) when the kick is taken.
It was heartbreak for Nigeria, who had produced a disciplined defensive performance to frustrate a partisan 28,267 crowd in Rennes.
France carved out plenty of chances but it was not until the 65th minute that they managed a first shot on target, Amel Majri shooting straight at the keeper.
Asked if she was satisfied with her side's efforts, Diacre added: "No, I think I'm always going to be asking my players to go that one step further.
"Yes, we were able to secure this third win, even though it wasn't easy for us. I think because it was so difficult, it makes the win all the sweeter."
Nigeria will have to wait to see if they qualify as a best-placed third place side. They have only qualified once before for the knockout stages, in 1999.