Jon Dadi Bodvarsson swept Iceland into an 18th-minute lead at the Stade de France, with Austria paying dearly for Aleksandar Dragovic’s missed first-half penalty.
Substitute Alessandro Schopf levelled for Austria on the hour, but Traustason’s 94th-minute strike condemned Marcel Koller’s side to a premature exit.
Iceland, the smallest nation to appear at a major finals, will play England in the last 16 in Nice after finishing second in the group, behind Hungary but above Portugal, following a thrilling 3-3 draw in Lyon.