A header by Andy Robertson in stoppage time allowed Scotland to beat Poland 2-1 in their Nations League clash on Monday evening.
The hosts were eager to bounce back after a painful 1-5 defeat to Portugal in Porto, but the visitors started the match in the best possible way.
Scotland broke the deadlock just three minutes into the game as John McGinn delivered a low shot near the post.
The first half witnessed plenty of scoring chances for both teams, but neither did them seize the opportunities.
Poland equalized in the 59th minute as Piotr Zielinski passed the ball across the edge of the penalty area before Kamil Piatkowski fired a thunderous shot into the top corner.
In the closing stages of the game, Poland seemed to be in control, but Scotland had the final say.
In the third minute of added time, John Souttar delivered a cross from the right wing to Andy Robertson, whose powerful header secured the visitors a crucial 2-1 victory.
The victory in Warsaw helped Scotland to move into the third place of League A Group 1, avoiding direct relegation to League B. They will now fight for their spot in League A during the play-offs.
Poland finished the fourth place at League A Group 1. Portugal led the Group, while Croatia claimed second position.