Wales were almost punished for trying to be too smart with their team selection. Caretaker coach Robin McBryde insisted he had not gambled by naming the most inexperienced team to represent Wales in a full international, yet it was the absence of a recognised openside flanker that nearly proved his downfall.
This was expected to be an open, free-flowing encounter, so the omission of Josh Navidi, the latest No 7 off the rank at Cardiff, was startling. Even with Sam Warburton and Justin Tipuric on duty with the British and Irish Lions, Navidi was only called up for the tour following an injury to Aaron Shingler, and rather than helping his team-mates hold on to the ball, he was left ferrying water bottles to and fro.
As a result, Japan's New Zealand-born flanker Michael Broadhurst had a field day. He stole one turnover after another as well as scoring a well-worked try direct from a line-out that would have brought a smile to the face of Steve Borthwick, who has been in Japan this week working with Eddie Jones's forwards.
Leading 11-6, Japan sensed what would have been a major scalp and a significant step forward for the game as they build towards hosting the 2019 World Cup.
Had their full-back, Ayumu Goromaru, not missed three kicks either side of half-time, the dream might have become reality. Instead Wales, to their credit, steadied themselves amid the soaring heat, humidity and buoyant home crowd to dig out a victory that will stand these young players, including six new caps, in far greater stead than any walkover.
Liam Williams saved two tries before conjuring a try for Harry Robinson that was enough, but only just, despite a late score by Yoshikazu Fujita.
McBryde said: "I'm not going to point fingers but there are lessons we have to learn from this game because next week will be another stern test. Perhaps as a coaching group we have to look at ourselves, at how much freedom we give the players to control the game.
"There is plenty for us to work on. In the first half we didn't deal with the conditions particularly well, didn't play as a team and weren't able to hold on to possession to create any pressure of our own. It wasn't pleasing from that side of things. But I'm immensely proud of the way they dug deep to win."
McBryde is likely to make changes for next Saturday's rematch in Tokyo, with Rhys Gill, Tavis Knoyle and Andries Pretorius all impressing off the bench.
Japan A Goromaru; Y Fujita, M Sau, C Wing (Y Tamura, 67), K Fukuoka (H Onozawa, 70); H Tatekawa, F Tanaka (A Hiwasa, 67); M Mikami (Y Nagae, 61), S Horie (T Kizu, 30-32, 71), H Yamashita (K Hatakeyama, 65), H Ono, S Ito, H Tui (T Kitagawa, 71, M Broadhurst, T Kikutani (capt).
Wales Liam Williams; H Robinson, O Williams, J Spratt, D Howells; D Biggar (R Patchell, 65), Lloyd Williams (T Knoyle, 60); R Bevington (R Gill, 53), E Phillips, S Andrews, B Davies (capt), L Reed, A Coombs (A Pretorius, 54), J King, R McCusker (D Baker, 60).
Referee Lourens van der Merwe (South Africa).
Tries: Broadhurst, Fujita
Pens: Goromaru (2)
Pens: Biggar (4) Patchell