Japan showed why they are serious contenders at the Women's World Cup by hammering Spain to finish top of Group C and book a last-16 showdown with Norway.
The 2011 world champions made it look easy by scoring three times before half-time, with Hinata Miyazawa getting two to take her tally to four goals and become the tournament's leading scorer.
The attacking midfielder put Japan ahead with a calm finish after Spain's defence had been exposed, before Riko Ueki doubled the lead with a deflected finish which looped into the net.
Miyazawa, who scored two in Japan's opening group game against Zambia, made it 3-0 by firing across goal and into the net in front of a crowd of 20,957.
Substitute Mina Tanaka added to Spain's pain with a fourth goal in the 83rd minute.
Japan started the third and final group game trailing Spain on goal difference after both teams had made 100% winning starts in New Zealand.
Japan will stay in Wellington, where they will meet Norway, the 1995 world champions, on Saturday at 09:00 BST.
Group runners-up Spain head to Auckland, where they will play Switzerland at Eden Park on Saturday at 06:00 BST.
Formidable Japan produce masterclass
Japan made five changes to the side that overcame Costa Rica in Dunedin five days earlier yet never looked back after taking control on a blustery evening in New Zealand's capital.
After wins against Zambia and Costa Rica, this was the night they really showed the world they mean business with a powerful performance which included some exceptional finishing against a Spain side high in confidence after back-to-back wins.
Miyazawa, who also laid on the assist for Ueki's goal, looks a real handful and will be crucial if the two-time finalists are to reach the quarter-finals for the first time since 2015.
Japan fans, who turned out in numbers in Wellington with some dressed in colourful masks and national costume, witnessed a masterclass from their team.
Japan had won only one of their past five World Cup games before this edition.
But they look formidable after a third successive win in New Zealand.
Poor Spain second best
Spain were a poor second best but must put this heavy defeat quickly behind them with a match against Switzerland to come at the weekend.
They were one of the first teams in Europe to qualify for this tournament after an impeccable qualifying campaign where they finished eight points clear at the top of the table and did not concede a goal in eight games.
Spain had not conceded a goal in 180 minutes before this match but were out-fought and out-classed by a classy Japan.
On a night of few positives for Jorge Vilda's side, Alexia Putellas got another 62 minutes on the pitch.
The two-time Ballon d'Or winner is working her way back to full fitness following a serious knee injury sustained before Euro 2022 which ruled her out for almost a year.
Player of the match
HasegawaYui Hasegawa
Japan
Squad number14Player nameHasegawa
Squad number13Player nameEndo
Squad number3Player nameMinami
Squad number9Player nameUeki
Squad number4Player nameKumagai
Squad number2Player nameShimizu
Squad number11Player nameTanaka
Squad number15Player nameFujino
Squad number8Player nameNaomoto
Squad number6Player nameSugita
Squad number10Player nameNagano
Squad number7Player nameMiyazawa
Squad number19Player nameMoriya
Squad number16Player nameHayashi
Squad number12Player nameTakahashi
Squad number1Player nameYamashita
Spain
Squad number2Player nameBatlle
Squad number15Player nameNavarro
Squad number21Player nameZornoza
Squad number12Player nameHernández
Squad number17Player nameRedondo
Squad number18Player nameParalluelo
Squad number6Player nameBonmatí
Squad number11Player namePutellas
Squad number9Player nameGonzález
Squad number4Player nameParedes
Squad number3Player nameAbelleira
Squad number1Player nameMisa
Squad number10Player nameHermoso
Squad number19Player nameCarmona
Squad number20Player nameGálvez
Squad number8Player nameMariona Caldentey
Line-ups
Japan
Formation 3-4-3
1Yamashita
12Takahashi4Kumagai3Minami
2Shimizu16Hayashi10Nagano13Endo
7Miyazawa9Ueki8Naomoto
1Yamashita12Takahashi4Kumagai3Minami2ShimizuSubstituted forMoriyaat 59'minutes16Hayashi10NaganoSubstituted forHasegawaat 59'minutes13EndoSubstituted forSugitaat 85'minutes7MiyazawaSubstituted forFujinoat 45'minutes9UekiSubstituted forTanakaat 68'minutes8NaomotoSubstitutes
5Miyake6Sugita11Tanaka14Hasegawa15Fujino17Seike18Tanaka19Moriya20Hamano21Hirao22Chiba23IshikawaSpain
Formation 4-3-3
1Rodríguez Rivero
2Batlle4Paredes20Gálvez19Carmona
6Bonmatí3Abelleira11Putellas
18Paralluelo10Hermoso8Caldentey Oliver
1Rodríguez Rivero2Batlle4Paredes20Gálvez19CarmonaBooked at 45minsSubstituted forHernándezat 45'minutesBooked at 89mins6Bonmatí3AbelleiraSubstituted forZornozaat 72'minutes11PutellasSubstituted forRedondoat 62'minutes18ParallueloSubstituted forGonzálezat 82'minutes10Hermoso8Caldentey OliverSubstituted forNavarroat 62'minutesSubstitutes
5Andrés7Guerrero9González12Hernández13Salón14Codina15Navarro16Pérez17Redondo21Zornoza22del Castillo23Coll LluchReferee:Katja KorolevaAttendance:20,957Live Text
Match ends, Japan 4, Spain 0.
Second Half ends, Japan 4, Spain 0.
Delay over. They are ready to continue.
Delay in match because of an injury Irene Paredes (Spain).
Attempt saved. Esther González (Spain) right footed shot from the centre of the box is saved in the bottom right corner. Assisted by Oihane Hernández with a cross.
Attempt missed. Hikaru Naomoto (Japan) right footed shot from outside the box is just a bit too high from a direct free kick.
Oihane Hernández (Spain) is shown the yellow card for a bad foul.
Foul by Oihane Hernández (Spain).
Hikaru Naomoto (Japan) wins a free kick in the attacking half.
Offside, Japan. Miyabi Moriya tries a through ball, but Aoba Fujino is caught offside.
Corner, Spain. Conceded by Moeka Minami.
Substitution, Japan. Hina Sugita replaces Jun Endo.
Alba Redondo (Spain) wins a free kick in the defensive half.
Foul by Hikaru Naomoto (Japan).
Goal! Japan 4, Spain 0. Mina Tanaka (Japan) left footed shot from the centre of the box to the top left corner. Assisted by Miyabi Moriya.
Substitution, Spain. Esther González replaces Salma Paralluelo.
Foul by Rocío Gálvez (Spain).
Mina Tanaka (Japan) wins a free kick in the defensive half.
Substitution, Spain. Claudia Zornoza replaces Teresa Abelleira.
Attempt missed. Teresa Abelleira (Spain) right footed shot from outside the box is too high. Assisted by Aitana Bonmatí.