The Netherlands reached the women's World Cup quarter-finals for the first time when Lieke Martens's last-gasp penalty earned them victory against Japan.
Martens put the Dutch in front after 17 minutes, only for Yui Hasegawa to level on the stroke of halftime, but the forward sent the European champions through with a spot kick in the last minute.
Japan, who hit the woodwork twice, dominated the second half but lacked a finishing touch.
The Netherlands, taking part in only their second women's World Cup, will play Italy in Valenciennes on Saturday after the Azzurre beat China 2-0 earlier on Tuesday.
The Oranje dominated early on with Vivianne Miedema's shot hitting the post and they were rewarded in the 17th minute when Martens back-heeled a corner into the net to open the scoring.
Japan, however, had their chances with Yuika Sugasawa racing through only to see her curled shot crash against the post.
They deservedly equalised two minutes before the interval as Hasegawa scored with a cool finish after being superbly played through by Mana Iwabuchi.
The pace dropped after the break, with the Netherlands controlling the match without putting Japan under the cosh.
Japan only mustered half chances until the 79th minute, when Hina Sugita's rising shot hit the crossbar just before Sari van Veenendaal was forced to save at full-stretch to deny Yuka Momiki.
The game eventually went the Netherlands's way when Saki Kumagai handled the ball in the area and Martens converted the resulting penalty.
The Netherlands' victory ensured that seven of the eight quarter-finalists were European.
"We were standing in the circle after the match and we were so happy, yelling at each other," Holland boss Sarina Wiegman said at her post-match press conference.
"We were saying 'let's continue writing history!' For the first time, we got to this stage at the World Cup. All the players then used this mantra."
Japan created plenty of chances to win the game themselves, twice hitting the woodwork and also missing a number of decent opportunities.
Head coach Asako Takakura felt it was that profligacy which ultimately decided the contest in favour of the Dutch.
"We knew it was going to be a difficult match and we needed to change our tactics - that was how we were going to play and overall we played really calmly," she said.
"Towards the end of the match in the second half we created many goalscoring opportunities, it was really unfortunate that we couldn't take them.
"I think we lacked the clinical edge. We have to accept the result, we're defeated, we're very disappointed and for all the players I feel very sorry for them and frustrated."