Match ends, Scotland Women 1, Spain Women 0.
|Women's Euro 207|
|Coverage: Live commentaries on BBC Radio 5 live and online, plus live text commentaries on the BBC Sport website. Live television coverage on Channel 4|
Scotland stunned Spain but missed out on a place in the Euro 2017 quarter-finals.
Goalkeeper Gemma Fay pulled off two fantastic saves before Caroline Weir drilled Scotland in front.
With England beating Portugal 2-1, Scotland needed to win by two goals and their best chance came when Leanne Crichton missed from three yards.
Silvia Meseguer hit the bar for Spain, while Scotland threw everything at them late on but could not fashion a goal.
It was a heartbreaking end to Scotland's first appearance at a major finals, but they restored pride after opening defeats by England and Portugal.
Scotland began the game knowing if they could win by two goals they would qualify for the knock-out stage, providing England beat Portugal in the other Group D match.
After an impressive performance from the bench against Portugal, Erin Cuthbert was rewarded with a starting place, one of four changes with Leanne Ross, Jo Love and Chloe Arthur all handed a shirt.
It was Scotland's Fay who was the busier of the two goalkeepers early on, though, as Marta Torrejon and Meseguer tested Scotland's early resolve.
And as the game wore on, Spain grew in confidence with Amanda Sampedro missing the target after Mariona Caldentey squared the ball for her.
Then Fay went from villain to hero. After flapping at a loose ball and conceding a corner, she twice pulled off stunning saves to push away headers from Jennifer Hermoso and Irene Paredes.
And she almost went back to being the villain when she raced from goal and handled outside the box. As the Spaniards roared for a red card, referee Jana Adamkova did Scotland a huge favour by reaching for just the yellow.
The Scots were hanging on, but against the run of play they took a stunning lead.
Cuthbert raced on to a through-ball, but was denied by Spanish goalkeeper Sandra Panos.
However, the ball fell for Weir who held off the goalkeeper's challenge and fired through the legs of Paredes, who could only help the ball into her own net.
Frankie Brown twice denied substitute Maria Paz at the near post with brave challenges to keep Scotland ahead, before Crichton somehow smashed a corner over the bar at the other end.
And the Spanish substitute was continuing to cause problems; bulleting a header into the side netting then drilling a shot wide of the far post minutes later.
Scotland needed a second goal but they were struggling to keep the Spanish at bay.
Meseguer was given far too much time and space to pick her spot, and Fay could only watch as her shot cracked off the crossbar.
Paz headed wide from close range, and she again went close when Ifeoma Dieke cleared off the line after Alexia Putellas had been denied by Fay.
A rare Scotland attack saw Lisa Evans force a save from distance but it always looked comfortable for Panos.
Time was ticking away for Scotland but they were becoming more of a threat. Crichton headed a Weir free-kick over, but that was as close as they could get in a frustrating finish to Anna Signeul's time as head coach, with Spain pipping Scotland to second place in the group.
- 1FayBooked at 39mins
- 17BrownBooked at 44mins
- 6LoveSubstituted forBrownat 73'minutes
- 5RossSubstituted forClellandat 45'minutes
- 13Paños García-Villamil
- 3Torrejón Moya
- 5Pereira Cejudo
- 4Paredes Hernández
- 21OuahabiBooked at 54minsSubstituted forCorredera Ruedaat 56'minutes
- 8Sampedro Bustos
- 15Meseguer Bellido
- 14Losada Gómez
- 22Caldentey OliverSubstituted forLatorre Viñalsat 79'minutes
- 10Hermoso FuentesSubstituted forVilas Donoat 45'minutes
- 11Putellas Segura
- 1Gallardo Nunez
- 2Jimenez Delgado
- 6Torrecilla Reyes
- 7Corredera Rueda
- 9Vilas Dono
- 17García Pérez
- 18Gonzalez Rodriguez
- 19Latorre Viñals
- 20León Cebrián
- Jana Adamkova
- Shots on Target
Second Half ends, Scotland Women 1, Spain Women 0.
Foul by Marta Corredera (Spain Women).
Erin Cuthbert (Scotland Women) wins a free kick in the attacking half.
Attempt saved. Marta Corredera (Spain Women) right footed shot from outside the box is saved in the bottom left corner.
Corner, Spain Women. Conceded by Ifeoma Dieke.
Attempt saved. Mari Paz Vilas (Spain Women) header from the centre of the box is saved in the top left corner. Assisted by Marta Torrejón with a cross.
Attempt missed. Leanne Crichton (Scotland Women) header from the centre of the box is too high. Assisted by Caroline Weir with a cross following a set piece situation.
Foul by Irene Paredes (Spain Women).
Fiona Brown (Scotland Women) wins a free kick on the right wing.
Foul by Marta Torrejón (Spain Women).
Lana Clelland (Scotland Women) wins a free kick on the left wing.
Attempt missed. Mari Paz Vilas (Spain Women) left footed shot from the left side of the box misses to the left. Assisted by Amanda Sampedro.
Irene Paredes (Spain Women) wins a free kick in the defensive half.
Foul by Fiona Brown (Scotland Women).
Attempt blocked. Fiona Brown (Scotland Women) left footed shot from the right side of the box is blocked.
Attempt blocked. Silvia Meseguer (Spain Women) right footed shot from outside the box is blocked. Assisted by Vicky Losada.
Attempt saved. Lisa Evans (Scotland Women) left footed shot from outside the box is saved in the top left corner. Assisted by Leanne Crichton.
Attempt blocked. Lana Clelland (Scotland Women) right footed shot from outside the box is blocked. Assisted by Caroline Weir.
Offside, Spain Women. Mari Paz Vilas tries a through ball, but Alexia Putellas is caught offside.