Tunisia beat Group D winners France 1-0 but it wasn't enough to qualify in a dramatic finale that saw Antoine Griezmann's goal ruled out by a late VAR review.
Wahbi Khazri scored the decisive goal on 58 minutes with a fantastic solo run as Tunisia took full advantage of Didier Deschamps making nine changes to his France side and resting Kylian Mbappe.
France only started to put pressure on in the latter stages when Mbappe was substituted on and they thought they had levelled it up when Griezmann fired home but an eventual VAR review spotted he was offside in the build-up.
With Australia beating Denmark to finish on six points, it meant Tunisia, who finished third, crashed out in strange fashion having taken four points off France and Denmark.
France are set to play the runners-up in Group C on Sunday at 3pm with a potential meeting with England in the quarter-finals if they win their last-16 game.