Scotland Under-19s 1-2 Spain Under-19sAntonio Bueno ended Scottish hopes of glory with a double strike for Spain in the European Under-19 Championship final in Poland.
The Real Madrid striker hit a sublime effort over Hibernian goalkeeper Andrew McNeil from 20 yards in the 50th minute.
He was again on hand to turn a low Gerard Pique cross past McNeil 21 minutes later.
Livingston striker Graeme Dorrans, who had been introduced to the game as a second-half substitute, grabbed a consolation three minutes before the end.
Dorrans could even have equalised in the final minute but shot straight at Spain goalkeeper Antonio Adan.
Scotland Under-19 coaches Archie Gemmill and Tommy Wilson had been forced into one change from the team which defeated the Czech Republic in the semi-final.
Hibernian striker Steven Fletcher was unfortunate to miss out after receiving a second yellow card of the tournament for diving in the semi, despite television evidence proving he merely stumbled in a challenge.
His natural replacement Robert Snodgrass was also suspended after earning his second caution after coming on for Fletcher in the last-four clash.
Instead, Celtic striker Charlie Grant returned to the starting 11 after missing the semi through a ban.
Norwich wing-back Andrew Cave-Brown was an early threat for the Scots, but it was not until the 12th minute before they forced Adan into action.
Hearts striker Calum Elliot made space for himself on the edge of the area before firing goalwards but the Real Madrid keeper palmed the effort away.
Spain's first real chance came on the half-hour mark but a flurry of Scottish defenders managed to block Antonio Calvo's effort.
Atletico Madrid midfielder Mario Suarez almost took advantage of a poor defensive clearance eight minutes later.
But his dipping 20-yard shot clipped the top of the crossbar and flew to safety.
Elliot almost troubled Adan again in the 42nd minute but his glancing header from a Cave-Brown cross was seen early and the goalkeeper collected comfortably.
Just a minute later though, Lee Wallace was grateful to see Calvo's ball along the six-yard box not followed up after the Spanish youngster got in behind the Hearts defender.
But, five minutes into the second period, the Spanish youngsters broke the deadlock with a sublime finish from Bueno.
The Real forward played a clever one-two with Suarez to out-manoeuvre the Scotland defence before chipping McNeil from 20 yards, leaving the Hibernian youngster flailing.
Two minutes later, McNeil saved the Scots with a tremendous save from Calvo, who was just five yards out.
Scotland were reeling and McNeil and his defence were rescued by the woodwork when a Pique header bounced off the ground and on to the crossbar from six yards.
In the 66th minute, Grant escaped the attentions of the Spanish defence but Adan was swift to spot the danger.
The Celtic man earned the first caution for a foul in the 71st minute but a greater punishment was to follow as a result of the set-piece.
Juan Mata floated the ball to Pique at the far post and he found Bueno inside the six-yard box to poke home Spain's second.
Elliot was looking for a 77th-minute penalty but the match official waved away his appeal.
An 84th-minute free-kick from Brian Gilmour had Adan scampering across his line but the strike flew just wide before Simon Ferry hit an effort straight at the keeper moments later.
Three minutes before the end, though, Scotland pulled a goal back.
Elliot chased a through to the by-line and pulled it across the six-yard line where Livingston forward Dorrans, who had replaced Greg Cameron in the 74th minute, was on hand to head home.
Dorrans almost claimed an equaliser in the final minute but his strike from a Jamie Adams ball was aimed straight at Adan.