Another step closer to "Adios", probably, to Scotland's chances of reaching Euro 2012, but on a night to remember, Craig Levein's side recovered from 2-0 down against the best team in the world to reach parity and put the Tartan Army in raptures, before Fernando Llorente snatched an always likely Iberian win.
Close but no cigar. A dream stolen; and the fantasy section of this dream lasted 13 minutes last night, from the 66th-minute equaliser for 2-2 to the 79th-minute goal for 3-2. These are recurring themes for the Tartan Army, and on and on they go.
Scotland have beaten reigning world champions before (England 1967, Argentina 1990), but to be within a goal of doing so against this astonishingly gifted Spanish team in such circumstances was something to savour, too.
"Every one of my players tonight is a hero for their efforts," Levein said. He was loathe to single anyone out though his description of goalkeeper Allan McGregor as "exceptional" was appropriate. Without his sterling efforts, Scotland might easily have been 4-0 or 5-0 down inside an hour.
David Villa put Spain ahead with a first-half penalty – his 44th goal in 70 caps make him Spain's all-time equal greatest scorer, with Raul – and Andres Iniesta made it 2-0 early in the second half. Stevie Naismith's header and a Gerard Pique own goal got Hampden rocking, literally. Then Llorente, nicknamed the "Lion King", roared, or rather scored.
"It didn't get to the point where I thought we'd actually lose the game," said Spain's manager, Vicente del Bosque. "But the speed with which Scotland were attacking back at us [to get to 2-2] did give us problems."
The upshot is that Spain are top of Group I with three wins from three games and nine points, ahead of the Czech Republic on six points from three games, then Scotland with four points from four. The Scots are mathematically still in contention for a play-off place; win their last four games or even three and they could snatch the runners-up spot. But as usual, it is an uphill task.
"I don't think it's over for Scotland by any means," Del Bosque said. "Although I consider the Czechs our main rivals for the group."
Levein ditched the 4-6-0 formation he fielded in the defeat in Prague last week in favour of a more adventurous 4-2-3-1 with an actual striker, Kenny Miller. Still, the aim was always likely to be to avoid a heavy beating, and as the first half drew to a close it seemed they were about to escape merely on the end of a 0-0 thrashing.
The visitors had not scored – by the 44th minute at least – for all their possession, probing and chances. But they had pretty much had the run of Hampden. Then Spain were award a penalty, harshly as far as the Scots were concerned, when Sergio Ramos's rising shot hit the back of Steven Whittaker's upper arm.
Villa hit the spot-kick low and to McGregor's left, and though the keeper got a hand to it, he could not keep it out.
The game looked up for Scotland 10 minutes into the second half when Andres Iniesta, after two blocks, passed into the net. But Kenny Miller's cross was helped in by Naismith's head, and a famous draw was on the cards. The last time Spain had failed to win any qualifier was in September 2007, in a 1-1.
The home side's equaliser arrived in the 66th minute, James Morrison's shot going in off Pique. However, 13 minutes later Llorente popped the Hampden balloon. And a second booking for Whittaker late on merely added to Scotland's pain.
Scotland (4-2-3-1): McGregor (Rangers); Bardsley (Sunderland), Weir (Rangers), McManus (M'brough), Whittaker (Rangers); McCulloch (Rangers), Fletcher (Man Utd); Morrison (West Brom), Dorrans (West Brom), Naismith (Rangers); Miller (Rangers). Substitutes used Adam (Blackpool) for McCulloch, h-t; Mackie (QPR) for Dorrans, 80; Maloney (Celtic) for Morrison, 88.
Spain (4-2-3-1): Casillas; Ramos, Pique, Puyol, Capdevila; Busquets, Alonso; Silva, Iniesta, Cazorla; Villa. Substitutes used Hernandez for Cazorla, 71, Llorente for Silva, 76, Marchena for Busquets, 90.
Referee M Busacca (Switzerland).