Some haphazard defending from Luis Milla's team cost them dear as the first-half strike gave the underdogs a dream start and provided the first big shock of the tournamentJapan ran out shock 1-0 winners over Spain in the Olympic Group D fixture at Hampden Park in Glasgow, courtesy of a goal in the 34th minute from Yuki Otsu following some questionable defending from Martin Montoya.
Kensuke Nagai and Hiroshi Kiyotake could have made it a more comfortable win for Takashi Sekizuka's side as both wasted good chances either side of half-time.
As it turned out, Otsu's goal in the 34th minute was enough to secure all three points for Japan, as their opponents struggled to trouble Shuichi Gonda in the Japan goal, particularly after going down to 10 men following Inigo Martinez's sending off at the end of the first half.
Spain produced the first goalscoring opportunity of the game in the fourth minute when Juan Mata played Rodrigo in with a neat pass. The former Bolton striker shifted the ball onto his left foot, before dragging a shot just wide 15 yards from goal.
Midway through the first half, Mata came close to breaking the deadlock with a swirling effort from distance, after cutting in from the right-hand side on to his favoured left foot, that Gonda did well to palm away to safety.
Despite Spain's dominance of possession in the first 25 minutes, Japan looked dangerous on the break, and grew in confidence as the half wore on, with their lone front-man Kensuke Nagai in particular proving a handful for the Spain defence.
Japan took a surprise 1-0 lead in the 34th minute through Yuki Otsu after he ghosted in at the back post to divert Takahiro Ogihara's inswinging corner from the left past a stranded David de Gea in the Spain goal. Martin Montoya's failure to pick up Otsu from the set piece gifted the 22-year old a goalscoring chance, and he made no mistake with his effort from 8 yards.
Sekizuka's side nearly increased their lead just minutes later when a terrible attempted back-pass from Alvaro Dominguez to De Gea went straight to Hiroshi Kiyotake inside the Spain penalty area. Kiyotake did well to jynx past the Spain goalkeeper, but in doing so took the ball far too wide for a clear shot on goal, and his eventual effort drifted harmlessly wide.
The first booking of the game came in the 40th minute as Jordi Alba was adjudged to have led with his elbow while challenging for the ball on the halfway line with Hiroshi Kiyotake.
Less than two minutes after their first booking, Spain were reduced to 10 men when Inigo Martinez was shown a straight red card by the referee Mark Geiger for obstructing a clear goalscoring opportunity for Nagai as the Japan striker broke towards the Spain penalty area.
Japan started the second half at a canter, with Keigo Higashi prompting a brilliant save from De Gea after curling a right-foot shot towards the top right corner from 20 yards out.
The Spanish defence was exposed once again shortly after that change with Nagai coming within inches of making it 2-0 after latching on to a decent through-ball from Hotaru Yamaguchi on the right and slotting a right-footed effort just wide of De Gea's left-hand post. Kiyotake then shot wide from a similar position minutes later.
Those two Japan chances appeared to spark Spain into life, and they began to move the ball forward with a far greater urgency, with Montoya providing some much-needed width down the right, and Mata beginning to dictate play from the centre of the pitch.
Despite the quality of their passing improving Spain failed to create any clearcut chances in the second half, with a firm Jordi Alba effort from an acute angle that Gonda deflected away the closest they came to drawing level as Japan eased to victory.
Japan nearly added a second in the dying moments of the game as the outstanding Nagai raced through and sent a left-foot shot goalwards that De Gea did superbly to keep out.
Both sides' next Group D fixture is on Sunday at St James' Park, as Japan play Morocco at 16:00 BST, while Spain take on Honduras later on in the afternoon at 18:45 BST.