A last-gasp goal from the much-maligned Chris Martin saved Scotland boss Gordon Strachan’s job and kept the World Cup dream alive for a little longer.
A brilliant run and pass from debut maker Stuart Armstrong set up Martin for the 88th-minute winner against Slovenia at Hampden in the World Cup Group F qualifier.
Anxiety had been creeping into the home side’s play when on came the Fulham loan man.
Some boos could even be heard from the fans as a player they hadn’t taken to their heart – until now – replaced James Morrison in the 82nd minute.
However, Martin pounced after Armstrong played him in and his low shot clipped the inside of the far post before nestling in the back of the net.
That was enough to clinch all three points and it looks like Strachan, who was expected to leave his post had they not won, will be in charge when Scotland host England on June 10.
It is still highly unlikely that Scotland will qualify for Russia but at least this gives everyone a lift.
It was a shame to see the wide, empty spaces inside Hampden as many supporters stayed away.
The dark blues came out with a distinctly green and white look about them.
There were no fewer than six Celtic players in Strachan’s side, with Armstrong joined by Parkhead keeper Craig Gordon, full-back Kieran Tierney, skipper Scott Brown, striker Leigh Griffiths and wide man James Forrest.
Armstrong’s inclusion was well deserved, given the former Dundee United man’s outstanding form for the Hoops this season.
With the selection heavily hinted at during the build-up to the game, the only surprise was Morrison getting the nod ahead of West Bromwich Albion colleague Darren Fletcher in the heart of midfield.
There was a perfectly-observed minute’s silence in memory of the victims of the Westminster terrorist atrocity then the action got under way.
With just a couple of minutes on the clock, the Scots almost took a dramatic lead.
Robert Snodgrass sent over a corner from the left and it was met brilliantly by defender Russell Martin, whose first-time shot brought a terrific save out of Slovenian goalie Jan Oblak.
This was a bright start by the home team but they had to do some defending when Valter Birsa broke into their box, with Andy Robertson on hand to execute a fine tackle.
It looked for a second as if the Scots had grabbed the lead on seven minutes when Martin nodded home another Snodgrass corner from the right but the “goal” was rightly chalked off for some blatant pushing by Martin on Miral Samardzic.
On 16 minutes a cross from Forrest was nodded across goal and wide of the far post by Griffiths as Scotland continued to threaten but the visitors sent them a wee reminder when Roman Bezjak smashed a shot at Gordon as he guarded his near post.
Ilicic fired over the Scotland bar before Morrison nearly brought the house down with a strike from outside the box that flew just wide.
The Scots then had two incredible chances to make the breakthrough, with Griffiths hitting the bar and post in quick succession.
On 35 minutes, Snodgrass, played in by the rampaging Robertson, raced into the box and chipped the ball into the goalmouth for the former Dundee striker, who smashed his volley off the bar.
He was only four yards out and should have burst the net.
Remarkably, Griffiths found woodwork yet again just a minute later when he met a cutback from Armstrong and smacked the post with his shot.
The hosts deserved to be a couple ahead at half-time but the whistle blew with the game still goalless.
Griffiths, who had taken a knee in the back from Slovenian keeper Oblak just before the break, came out for the second period but only lasted four minutes before being replaced by Steven Naismith.
Slovenia looked much more interested this half, while some of the oomph seemed to have gone out of the home side’s play.
Naismith was guilty of a push as he won a header inside the box on 57 minutes then Robertson sent a cross out with a group teammates waiting in the goalmouth. Naismith got on the end of another Snodgrass cross on 68 minutes but couldn’t threaten the goal.
Nerves were creeping into both the Tartan Army and the Scots’ play as time ticked by. The spark of the first half had gone and Slovenia looked comfortable.
Snodgrass snatched at his shot from inside the area before he was replaced by Ikechi Anya with for the last quarter-of-an-hour.
Just a minute after coming on Anya had a wonderful chance to be an instant hero when the ball broke his way 10 yards out but his shot was saved by the diving Oblak.
Forrest broke clear inside the area but couldn’t pick out a blue jersey then Scotland used their final sub with eight minutes to go, Martin replacing Morrison.
The switch worked out a treat for Strachan and Scotland, with Martin turning out to be the unlikely hero.
Scotland: Gordon, Tierney, Robertson, R. Martin, Mulgrew, Armstrong, Morrison (C. Martin 82), Brown, Griffiths (Naismith 49), Snodgrass (Anya 75), Forrest. Subs not used: Hamilton, McGregor, Berra, McGinn, Ritchie, Fletcher, Bannan, Cairney, Rhodes.
Slovenia: Oblak, Samardzic, Cesar, Krhin, Ilicic, Kurtic, Birsa (Beric 69), Jokic, Bezjak (Verbic 59), Kampl (Omladic 87), Aljaz Struna. Subs not used: Koprivec, Belec, Sirok, Krajnk, Novakovic, Andraz Struna, Mevlja, Zajc, Crnic.
Referee: Bjorn Kuipers (Netherlands).