Scotland's Euro 2012 qualifying campaign ended in failure as they lost heavily to Spain in Alicante.
A first-half brace from David Silva and a third from David Villa meant David Goodwillie's 66th-minute penalty was of little consolation to travelling fans.
The Scots finish Group I in third place with 11 points from eight fixtures.
The Czech Republic's 4-1 win over Lithuania means they go into Thursday's play-off draw at the expense of Craig Levein's side.
Scotland's coach had named an unchanged line-up for their final fixture, with Craig Mackail-Smith again playing as a lone striker in a 4-1-4-1 formation.
Levein 'encouraged' by Scotland progress
Spain, meanwhile, made six changes, among them goalkeeper Iker Casillas being rested in favour of Victor Valdes and Fernando Torres replaced by Villa up front.
And the world champions were immediately in control, with Scotland failing to get a touch of the ball in the opening two minutes of play.
Seconds later, news filtered through from Lithuania that the Czech Republic had gone a goal up through a Michal Kadlec penalty as they headed for a win that would mean Scotland had to defeat the world champions to prevent the Czechs taking second place in the group.
That task was made harder in the sixth minute, when Jordi Alba, making his debut for Spain, sent in a cross from the byline that found Silva, who drove the ball under goalkeeper Allan McGregor from 10 yards.
Davd Goodwillie scored his first international goal from the spot
A shell-shocked Scotland had the chance to respond two minutes later when Steven Naismith was on the end of Barry Bannan's cross in from the left, but the angle was too difficult for the Rangers striker to hit the target.
McGregor saved from Santi Cazorla and Pedro as Levein's side were not allowed to settle with wave after wave of attack from the Spaniards.
News after 18 minutes that the Czech Republic had gone 2-0 up in Lithuania only served to make Scotland's efforts appear all the more futile.
There were further chances for Cazorla and Carlos Puyol, before Naismith was again frustrated in front of goal by a well-timed Gerard Pique challenge.
A Naismith flick set up his captain, Darren Fletcher, but the Manchester United midfielder sent his drive over the crossbar from 16 yards.
However, Spain continued to coolly dictate the game and their patience paid off just before half-time.
Silva darted from the halfway line to the edge of McGregor's box then casually exchanged a one-two with Pedro before slipping a left-footed shot past McGregor.
Scotland's strategy after the break was clear when McGregor fired the ball across the length of the pitch to Mackail-Smith, whose right-footed shot from 20 yards out was on target but straight into the hands of Valdes.
Spain 'unplayable' - Naismith
While Scotland hit and hoped, Spain continued to craft and their third was a collaboration between Silva and Villa.
The Manchester City midfielder surged through the Scotland defence before unselfishlessly holding up the ball in anticipation of Villa's run, the Barcelona striker slotting home for his 50th international goal.
With the deficit growing, Levein introduced Goodwillie as an additional striker and the Blackburn Rovers player was called into action almost immediately when Mackail-Smith was upended by Valdes having pounced upon a loose ball.
Goodwillie slotting home from the spot, but any lingering hope of a Scotland comeback died when he drove high and wide with 10 minutes left rather than play in the well-positioned Mackail-Smith as Spain finished their qualifying campaign with a 100% record.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.