Andy Robertson scored deep into injury time to guide Scotland to a win over Poland and avoid immediate relegation in the UEFA Nations League.
A last-gasp goal by Andy Robertson gave Scotland a 2-1 away win over Poland in a pulsating Nations League Group A1 clash on Monday (Nov 18), a result that saw the Scots enter a relegation playoff while the Poles are relegated to the second-tier League B.
John McGinn put Scotland in front after three minutes before Poland's Kamil Piatkowski levelled with a stunning strike just before the hour. Robertson sealed the victory in stoppage time with a header that bounced in off the inside of the post.
Scotland, playing in the competition's top tier for the first time, finished third on seven points, three above last-placed Poland, who have never dropped out of League A since the competition was launched in 2018.
Portugal, who clinched top spot and a place in the quarter-finals last week, have 14 points while Croatia, who are second with eight points, sealed a last-eight berth with a 1-1 home draw against the Portuguese in their final game also on Monday.
Scotland find out their next opponents in Friday's draw, with a two-legged League A/B playoff tie on Mar 20 and 23.
The Scots got off to a flying start when McGinn, who had secured a late victory against Croatia last time out, gave them an early lead with a low strike inside the left corner.
Ben Doak received the ball on the edge of the area and teed up the midfielder, who struck the ball calmly first time.
Poland reacted instantly and Piatkowski forced Scotland goalkeeper Craig Gordon into a diving save to deny him from distance before Karol Swiderski only found the side netting.
With Swiderski and Adam Buksa up front for the hosts in the absence of their injured all-time top scorer Robert Lewandowski, Poland intensified their efforts and Swiderski had another chance but was denied by Gordon minutes later.
The opportunities kept coming for both sides and Billy Gilmour and Scott McTominay should have doubled the lead for Scotland before the break but hit the woodwork.
Poland equalised in the 59th minute through Piatkowski after Piotr Zielinski teed up the defender who cut across the ball to fire into the far top corner for his first international goal.
Poland keeper Lukasz Skorupski stretched to keep out Lyndon Dykes' header six minutes later, but just when the hosts thought they had preserved their top-tier status Robertson connected with John Souttar's cross and gave Skorupski no chance.