Match ends, Scotland 1, Slovenia 0.
Chris Martin scored late on as Scotland saw off Slovenia to keep their slim hopes of reaching the World Cup alive.
The home side produced an excellent first-half showing, with Leigh Griffiths hitting the bar then post.
The visitors improved after the break but substitute Martin's left-foot finish with two minutes left won it.
Scotland, whose head coach Gordon Strachan had described this match as a must-win, are now fourth in Group F, two points behind Slovakia in second.
England are top of the table on 13 points after their 2-0 win over Lithuania earlier on Sunday.
Scots come out fighting
Strachan picked Kieran Tierney, Celtic's teenage left-back, at right-back and turned to Griffiths as his main striker.
With their backs to the wall, Scotland came out fighting with an intensity that set Slovenia rocking.
- How the players rated with Billy Dodds
- Martin in great company - Strachan
- Scotland's win as it happened
The game was only a minute old when keeper Jan Oblak dived away to his right to keep out a Russell Martin volley from a Robert Snodgrass corner, but the siege on the Slovenian penalty area carried on and on.
Martin caused more bother a few moments later when he headed home from another Snodgrass cross, but the big defender was done for a push. Then it was Griffiths' turn, his angled header, after excellent work from the terrific Stuart Armstrong, drifted wide.
This was a different Scotland and a jittery Slovenia. Defensively, they were an unadulterated mess. Offensively, they scarcely existed save for one effort from Roman Bezjak that Craig Gordon dealt with.
The Griffiths show
Towards the end of the opening half, Scotland upped the ante and came painfully close to scoring. James Morrison thundered a shot just wide, then it became the Griffiths show, a mini soap opera amid a major drama.
A fine Scottish move saw the splendid Andy Robertson put Snodgrass away down the left side of the penalty box. The West Ham midfielder clipped a precise cross towards the back post where Griffiths was lurking. The Celtic man had to score, simply had to. Instead, from point-blank range inside the six-yard box, Griffiths smashed his volley onto the crossbar.
It was a miss that shocked Hampden. There was a small crowd in the old place, but their groans were almost deafening in that moment. A minute later, though, Griffiths had another chance when a great surge and nice delivery from Armstrong presented another chance to the Celtic striker.
This was considerably harder, and he made a good fist of it, steering his right-foot shot off the inside of Oblak's left-hand post. The ball rolled across goal and was hoofed clear. Griffiths was desperately unlucky.
In this mad flurry, there was another Scottish opportunity. A further minute on from Griffiths' second chance, Morrison had a looping header cleared off the line by Valter Birsa. All this good stuff, all these chances and nothing to show for it was torture for the hosts.
Strachan fights on
Griffiths took a dunt from Oblak in the dying minutes of the opening half and he was replaced by Steven Naismith in the opening minutes of the second half. Scotland lost their edge as the game wore on, though.
They had huge amounts of possession but not enough accuracy and nothing like the chances they had earlier in the game.
There was one, however. A good one. With 15 minutes left, Ikechi Anya replaced Snodgrass and within seconds, more slapstick Slovenian defending created an opportunity for the substitute. With time and space, he tried to curl his shot around Oblak, but didn't get nearly enough on it. Oblak made an easy save. Hampden held its head in its hands again.
Strachan brought on Chris Martin in a frantic attempt to salvage the victory they desperately needed. And what a twist he served up. Martin was booed on to the field by sections of the home support, but with two minutes left, more clever work from Armstrong set up the striker, who hit his shot low past a stunned Oblak and in off his left-hand post.
It was a thoroughly deserved winner on a dramatic night. Scotland found their best performance of the campaign and get to dream on. Strachan, meanwhile, lives to fight another day.
- 7MorrisonSubstituted forMartinat 82'minutes
- 6S Armstrong
- 10SnodgrassSubstituted forAnyaat 75'minutes
- 9GriffithsSubstituted forNaismithat 50'minutes
- 4SamardzicBooked at 90mins
- 5CesarBooked at 23mins
- 13JokicBooked at 6mins
- 20KamplSubstituted forOmladicat 87'minutes
- 10BirsaBooked at 62minsSubstituted forBericat 69'minutes
- 14BezjakBooked at 55minsSubstituted forVerbicat 58'minutes
- Björn Kuipers
- Shots on Target
Second Half ends, Scotland 1, Slovenia 0.
Delay over. They are ready to continue.
Delay in match Jasmin Kurtic (Slovenia) because of an injury.
James Forrest (Scotland) wins a free kick on the right wing.
Foul by Bojan Jokic (Slovenia).
Miral Samardzic (Slovenia) is shown the yellow card for a bad foul.
Chris Martin (Scotland) wins a free kick in the defensive half.
Foul by Miral Samardzic (Slovenia).
Foul by Ikechi Anya (Scotland).
Nik Omladic (Slovenia) wins a free kick in the defensive half.
Goal! Scotland 1, Slovenia 0. Chris Martin (Scotland) left footed shot from the left side of the box to the bottom right corner. Assisted by Stuart Armstrong.
Substitution, Slovenia. Nik Omladic replaces Kevin Kampl.
Scott Brown (Scotland) wins a free kick on the right wing.
Foul by Jasmin Kurtic (Slovenia).
Steven Naismith (Scotland) wins a free kick in the defensive half.
Foul by Benjamin Verbic (Slovenia).
Hand ball by Stuart Armstrong (Scotland).
Attempt saved. Steven Naismith (Scotland) right footed shot from outside the box is saved in the centre of the goal. Assisted by Chris Martin.
Foul by Ikechi Anya (Scotland).