Japan repeatedly cut the European U21 champions to shreds following Inigo Martinez's dismissal four minutes before half-time.
Martinez was shown a straight red card for a professional foul - had the referee played advantage, Japan would have been 2-0 up as they netted seconds later.
Spain boasted the likes of Juan Mata, Jordi Alba and Javi Martinez in their starting XI, all of whom featured in their senior side's Euro 2012 victory, but they were comprehensively outplayed by quick-breaking Japan. De Gea was arguably the man-of-the-match.
Luis Milla's team applied some late pressure but left gaping holes at the back, which Japan failed to exploit despite creating countless clear-cut opportunities, Kensuke Nagai particularly wasteful although he had an otherwise fine game up front.
The final whistle was greeted by wild celebrations from Takashi Sekizuka's side, with some of his players reduced to tears by the result.
Asked if this was Japan's best ever win Sekizuka said: "We looked forward to the match very much and showing how much we have to offer was the main point.
"Now we have to prepare for winning the games against Morocco and Honduras but I am very pleased with the result today."
On a day when all 16 teams were in action, there was also a win for Belarus, playing in their first major international tournament, beating New Zealand 1-0 at Coventry.
Despite Spain's hopes of winning the title, Brazil are favourites to take their first Olympic gold.
Egypt rallied in the second half with goals by Mohamed Aboutrika and Mohamed Salah with 14 minutes to play.
Neymar, who scored from a header, said: "We need to improve, but it is always better to improve for the next match after a win."
Uruguay, back in the Games after an 84-year absence, came from behind to beat a lively United Arab Emirates side 2-1 in the opening game at Old Trafford.
Uruguay, who won the second of their two golds in 1928, preserved their record of never losing in the Olympics.
Substitute Nicolas Lodeiro scored Uruguay's winner while captain Luis Suarez was booed every time he touched the ball by a Manchester crowd unforgiving of the Liverpool player's racial spat with United's Patrice Evra last season that earned him a lengthy ban.
Suarez said: "This is just one more match. I'm used to playing in stadiums where I'm booed. It doesn't worry me in the least. They boo me at almost every stadium in England, it's normal. I'd rather highlight the support from the Uruguayan fans."
In Thursday's other matches, Morocco and Honduras drew 2-2 at Hampden while Mexico and South Korea finished 0-0 at St James' Park, the venue for Switzerland's 1-1 draw with Gabon.
The Swiss finished with 10 men after defender Oliver Buff was red carded for diving having earlier been booked.
Morocco also finished with 10 men after defender Zakarya Bergdich was sent off 19 minutes from time against Honduras.