Scotland finished their unsuccessful World Cup qualifying campaign with a fine victory in Slovenia.
Darren Fletcher fired the Scots into a fourth minute lead with a wonderful shot from long range.
James McFadden blazed a great chance wide but made amends with a fantastic strike early in the second period.
But the finest goal was saved for the 84th minute with Paul Hartley curling in a perfect shot after a great passing move around the Slovenia penalty box.
The Scots finished five points off the Group Five play-off spot in third place and have secured a fourth-seeding for the Euro 2008 draw.
Anything less than a win in Celje would have seen the Scots among the fifth seeds.
Walter Smith's side turned in an impressive counter-attacking display to help get over Saturday's miserable home defeat to Belarus.
And Scotland got off to the perfect start when Manchester United youngster Fletcher let fly with a wonderful shot that found the top corner of the net from 25 yards.
Slovenia were very disjointed and guilty of giving away lots of fouls but came close when Robert Koren's header flashed narrowly wide.
Eight minutes before the interval McFadden squandered a wonderful chance to extend Scotland's lead.
A quick breakaway saw Kenny Miller play McFadden in with a perfect pass but the Everton forward made a horrible mess of his shot, scooping the ball over from 10 yards with just the keeper to beat.
Goalkeeper Craig Gordon was rarely troubled in the first half but had to tip over a 30-yard rocket from Milenko Acimovic as the interval approached.
Hibs pair Garry O'Connor and Gary Caldwell were introduced at half-time, with Steven Pressley and Kenny Miller the men to make way.
Darren Fletcher fired Scotland into an early lead
And four minutes into the second period Scotland were further ahead, with McFadden atoning for his earlier miss.
Fletcher wrong-footed the Slovenia defence with a cute square pass and McFadden took a touch before finding the net with a great dipping shot from the edge of the penalty area.
Acimovic fired in another impressive long-range shot but his fierce effort struck the crossbar with Gordon grasping at fresh air.
Scotland's good fortune continued when Bostjan Cesar somehow bundled the ball wide from no more than two yards out.
The game appeared to be petering out until Scotland capped an excellent performance with a great counter-attacking goal.
O'Connor played the ball across the 18-yard line and a great dummy from Gary Caldwell allowed Fletcher to pick out Hartley, who floated the ball home with a composed chip.
Slovenia: Handanovic, Matej Mavric (Pecnik 25), Cesar, Knavs, Koren, Ceh, Komac, Zlogar, Cimirotic, Rodic (Siljak 55), Acimovic, Pecnik (Ilic 58).
Subs Not Used: Nemec, Filekovic, Stevanovic, Pokorn.
Booked: Ceh, Rodic.
Scotland: Gordon, Dailly, Graham Alexander, Pressley (O'Connor 46), Weir, Webster, Fletcher, Quashie (Steven Caldwell 72), Miller (Gary Caldwell 46), Hartley, McFadden.
Subs Not Used: Neil Alexander, McCann, Beattie, Maloney.
Booked: Gordon, Gary Caldwell. Goals: Fletcher 4, McFadden 47, Hartley 84.
Ref: Rene Temmink (Netherlands)