Wahbi Khazri’s second-half goal, the North African side’s first of the tournament, was enough to secure victory, with France short of continuity and control after Didier Deschamps had named a disjointed starting eleven with qualification for the knockout rounds already secure.
Tunisia started the brighter of the two nations, taking advantage of the oddly-constructed French team featuring nine new starters and a glut of midfielders, and drawing on the support of passionate fans, with a large contingent of travelling Tunisians in Qatar whistling every French touch.
It looked as if they had an early goal to celebrate, too, but the offside flag denied Nader Ghandri after the defender had volleyed smartly home inside the opening 10 minutes.
With France desperately short of forward thrust and direction, Deschamps was forced to introduce Kylian Mbappe, Adrien Rabiot and Antoine Griezmann, but the Tunisians held firm.
There was drama late on as Griezmann looked to have fired in the latest of equalisers, but a belated VAR check ruled that the forward had been offside in the build-up, granting Tunisia a last-gasp reprieve and famous win.
France top Group D and are joined in the last 16 by Australia, who narrowly squeezed out Denmark to deny Tunisia progress.
But for the 10 French-born players in the Tunisian squad, and the 700,000 or so members of the North African nation’s diaspora in France, this was a particularly proud victory and a valiant exit.