France will go into next week's crucial World Cup qualifier against Spain on the back of a defeat after substitute Yasuyuki Konno's 88th-minute goal gave Japan a 1-0 win in Friday's friendly at Stade de France.
The hosts had largely controlled the game but they were caught cold with two minutes to play when Konno volleyed home Yuto Nagatomo's cross following a rapid counter-attack.
It was Japan's first win over France in six attempts and a first defeat for Didier Deschamps in his fourth game since taking over from Laurent Blanc at the France helm.
The former Marseille coach will hope the damage is not too profound ahead of Tuesday's pivotal Group I game with Spain in Madrid, while Japan will head into their friendly against Brazil in Poland with a spring in their step.
Despite a patchy pitch at the French national stadium, the hosts settled quickly and won five corners in the first 10 minutes, one of which was headed narrowly wide by Laurent Koscielny in the fourth minute.
Deschamps' desire to find a place in his starting XI for Arsenal striker Olivier Giroud obliged Karim Benzema to play on the left, but the Real Madrid man was nonetheless a constant threat in the first half.
After heading Giroud's feathered cross straight at Japan goalkeeper Eiji Kawashima in the seventh minute, he shot wide three times before forcing Kawashima into action again with a well-placed free-kick from 20 yards.
Benzema left the fray at half-time, in one of three changes made by Deschamps, and although France remained on top, there was a scare in the 55th minute.
Hugo Lloris could not hold a low free-kick from Kengo Nakamura and the rebound was collected by Shinji Kagawa, but he could only drag the ball across the face of goal.
Japan were coming into the game more and more, with Manchester United's Kagawa repositioned in a central role, and Deschamps elected to introduce Franck Ribery from the bench.
The Bayern Munich winger worked Kawashima with a deflected effort in the 74th minute, before an angled pass from fellow substitute Mathieu Valbuena almost rolled straight in after Kawashima was distracted by Giroud's attempt to play the ball.
The game opened up, Lloris just getting enough on a Nagatomo centre to take the ball away from Mike Havenaar, before Bafetimbi Gomis headed in Giroud's overhead kick at the other end, only for the goal to be ruled out for offside.
Kawashima then had to drop quickly to block a near-post shot from Ribery, before an eventful denouement culminated in Konno's winner.
Twice Kawashima was solicited, thwarting Giroud and then Valbuena from range, but from the corner that followed Valbuena's attempt, Japan broke at speed and Nagatomo crossed for Konno to convert the winner.