Stunning goals by substitutes Kieran Tierney and Kenny McLean in added time gave Scotland a momentous 4-2 win over Denmark to book the Scots their place at the World Cup finals for the first time since 1998.
Scott McTominay opened proceedings in the third minute with a glorious overhead kick from 12 yards but Rasmus Hojlund equalised from the spot in the 57th to quieten the Tartan Army.
His teammate Rasmus Kristensen was sent off in the 61st minute for picking up the second of two yellow cards and as the game took yet another twist, substitute Lawrence Shankland restored Scotland's lead in the 78th only for Patrick Dorgu to level three minutes later.
However, in the six minutes of added time, Tierney fired in from 25 yards with McLean scoring from the halfway line to top Group C in one of the great nights in Scotland's history.
Spain were held to a 2-2 home draw at Turkey but guaranteed first place in Group E and equalled Italy's 31-match unbeaten streak in competitive matches. Italy's record came between 2018 and 2021.
A 1-1 home draw against Bosnia and Herzegovina was enough for Austria in Group H, while Belgium routed Liechtenstein 7-0. Switzerland qualified after a 1-1 draw at Kosovo.
The 12 group winners qualified directly, while the runners-up will participate in playoffs along with the four best-ranked group winners of the 2024-25 Nations League that did not finish first or second in their groups.
The playoffs will be played on March 26 and March 31.
The World Cup will be played in the United States, Mexico and Canada from June 11 to July 19.
With PA.