Scotland's dream of reaching the 2016 European Championship finals in France were ended by an injury-time leveller by Poland striker Robert Lewandowski at Hampden Park.
There was less than three minutes played when the in-form Bayern striker gave the visitors the lead, but wide-man Matt Ritchie thundered in a shot from outside the box seconds from the interval and striker Steven Fletcher put the home side ahead with a wonderful curling strike just on the hour mark.
However, with seconds of four added minutes remaining, Lewandowski knocked the ball in from inches out following a Kamil Grosicki free-kick to make it 2-2 to leave Scotland six points outside a play-off spot ahead of their final Group D fixture against Gibraltar in Portugal on Sunday.
Gordon Strachan's side started the game in fourth place and while there were several permutations which would see them win a play-off spot, they knew one certainty - defeat and hopes of reaching the finals were over.
There was less than two-and-a-half minutes on the clock when Arkadiusz Milik split the Scotland defence with a slide-rule pass and Lewandowski, with some inevitability, raced clear to beat goalkeeper David Marshall at his near post with a shot from 10 yards.
A Ritchie strike from distance flew wide but at least suggested that Scotland were getting closer to testing Polish keeper Lukasz Fabianski and seconds from the interval he unleashed a left-footed drive from 25 yards which flew into the top corner to send the Scotland fans wild with unexpected delight.
The Scotland fans were in raptures again in the 61st minute when Ritchie fed Fletcher and from just inside the box the Sunderland striker curled the ball past Fabianski and into the net.
The final stages were fraught. Poland kept pushing for the leveller but in the last seconds of four added minutes, from Grosicki's free-kick, Lewandowski bundled it over the line to deliver a cruel blow to the home side.
SCOTLAND: Marshall, Hutton, Russell Martin, Hanley, Whittaker, Forrest (Dorrans 84), Brown, Darren Fletcher (McArthur 74), Ritchie, Naismith (Maloney 69), Steven Fletcher.
Goals: Ritchie 45, Steven Fletcher 62.
Poland: Fabianski, Piszczek, Pazdan, Glik, Rybus (Wawrzyniak 71), Grosicki, Krychowiak, Maczynski, Milik, Blaszczykowski (Olkowski 83),Lewandowski.
Goals: Lewandowski 3,90.
Referee: Viktor Kassai (Hungary).