Go Oiwa's troops stormed to the summit in Group D with nine points from a possible nine, while La Roja had to accept the runners-up spot in Group C behind Egypt.
Match preview
Translating their pre-tournament form into an exceptional run of group-stage results, Japan proved a class above all of Paraguay, Mali and Israel in Group D and were just one of two sides to prevail in all three group encounters, alongside hosts France.
Oiwa's outfit also matched Thierry Henry's side in both of the scoring metrics, notching seven goals of their own while conceding a grand total of zero, and they started as they meant to go on with a 5-0 demolition of Paraguay in their opening battle.
Japan's succeeding victories over Mali and Israel were nowhere near as emphatic, and Oiwa's men had to wait until the final 10 minutes on both occasions to nab the all-important goal, as Rihito Yamamoto saw off the African nation on July 27.
Three days later, Japan's 100% record was mere moments away from being extinguished against Israel, only for substitute Mao Hosoya to strike in second-half injury time and notch a seventh win from eight games in all tournaments for the four-time quarter-finalists.
Yet to finish on the Games podium, fourth-placed rankings at the London 2012 Olympics and their home event - Tokyo 2020 - represent Japan's best results in men's football thus far, but the recent exploits of Oiwa's team suggest that a medal around their necks is not beyond the realm of possibility.
Up until matchday three in Group C, the Spaniards were also on course to surge into the knockout rounds with nine points from an available nine, having seen off the threat of both Uzbekistan and the Dominican Republic before a top-of-the-table slog with Egypt.
However, Santi Denia's men were powerless to quell the brilliance of Ibrahim Adel, who struck either side of the half-time whistle to leave La Roja with a mountain to climb, one which they got halfway up thanks to Samu Omorodion's injury-time strike.
The Atletico Madrid attacker's effort proved to be nothing more than a consolation for Denia's men, though, as Egypt upset the apple cart with that 2-1 win and leapfrogged Spain into first place by a single point, consigning La Roja to the runners-up placement.
Then again, the 1992 champions made it to the gold medal match at the Sydney 2000 Games despite finishing second in their group, and more recent history is on Spain's side when it comes to head-to-head battles against the Japanese.
Indeed, a Marco Asensio extra-time strike propelled La Roja to a gripping 1-0 semi-final win over Japan at the Tokyo 2020 Games, seeing Spain avenge their identical loss to their opponents at London 2012, where David de Gea and Juan Mata were among the household names in action.
Japan Olympic Games Men's Football form:
W
W
W
Spain Olympic Games Men's Football form:
W
W
L
Team News
Japan's triumph over Israel was somewhat of a sobering experience for Yamamoto, who after scoring in both of his nation's opening contests only lasted until the half-time whistle on matchday three.
There is no suggestion that the 22-yeear-old is carrying an injury of any sort, though, so Oiwa ought to hand him the armband once again for the quarter-final, where Hosoya has also put his name in the hat for a start.
Ryotaro Araki looks to be the most likely candidate to make way for Hosoya if his Israel heroics are rewarded, but Oiwa should otherwise stick with a successful formula.
As for the men in red, head coach Denia could not call upon the services of Barcelona starlet Pau Cubarsi against Japan, as the centre-back had to serve a suspension on account of picking up two yellow cards in two games.
However, Cubarsi is now back, refreshed and ready to go for the quarter-final, where Denia should revert to a full-strength XI after making a handful of alterations for the Egypt defeat.
Alex Baena, Fermin Lopez and Eric Garcia should be among the other recognisable names coming back in for the opening knockout game, where Arnau Tenas will also replace Alejandro Iturbe in goal.
Japan possible starting lineup:
Kokubo; Nishio, Suzuki, Kimura, Uchino; Yamamoto, Kawasaki; Yamada, Hosoya, Sato; Fujio
Spain possible starting lineup:
Tenas; Sanchez, Cubarsi, Garcia, Miranda; Lopez, Barrios, Baena; Oroz, Ruiz, Gomez
We say: Japan 1-3 Spain
Spain's uncharacteristic loss to Egypt should certainly be taken with a pinch of salt, as Denia made a multitude of changes with a quarter-final place already secured.
La Roja's backline remains permeable, but Denia's well-rested big-hitters should make their presence felt at the other end of the pitch to wreck Japan's perfect defensive record and storm into the semis.