Scot Gemmill’s side needed a point from their final group match after they had earlier beaten the Faroe Islands and drew with Hungary.
It seemed they would get it in Velika Gorika after Rangers striker Zak Rudden had cancelled out a first-half goal from tournament top scorer, Lyon striker Amine Gouiri.
But the French – who hit the woodwork three times in the final seven minutes – finally grabbed the winner they needed to qualify in the last minute through Gouiri to hand the Scots their first defeat in nine games this season.
However, Gemmill insisted his players could go home with their heads held high. He said: “I’m extremely proud of the players. We have lost one game all year and came within a minute of the quarter-finals of the European Championships. These players deserve so much credit. The staff couldn’t be more proud of them. Most people wouldn’t expect Scotland to come out and score against France. Most people would have thought France will come out and get a second goal. But this team is not like that. They came out and showed the fight and belief that they have got.
“They are all young human beings and when you play football for 15 years or so you will get those disappointments. It’s how you handle them. The players will get their heads up and realise what they’ve achieved.”
SFA performance director Malky MacKay helped warm up the young Scotls, who had made one change from their draw with Hungary with Wolves’ Elliot Watt replacing Aberdeen midfielder Sebastian Ross.
Scotland came close to taking a shock lead seven minutes from the break with their first proper attack. Great link-up play between Jack Aitchson and Rudden allowed Glenn Middleton to burst into the box and his shot took a deflection and cracked off the outside of the post.
They were immediately made to regret that missed opportunity when the French netted the opener two minutes later. A looping cross from PSG youngster Yacine Adli was misjudged by keeper Jon McCracken, who flapped at it and Gouri was able to bundle the ball into an empty net.
Scotland got off to the best possible start after the break when they stunned the French with an equaliser 90 seconds into the second half. A deep swinging corner from Watt was nodded into the net by the unmarked Rudden to draw the Scots level.
An increasingly panicking French side threw the kitchen sink at Scotland as the half wore on, but it looked as if the woodwork would save the young Scots.
But, in trademark gut-wrenching Scotland style, the French netted in the final minute through strike sensation Gouiri, who lashed home from close range to devastate Gemmill’s side.