Capital-based players Rhona Lloyd and Sarah Law scored tries, but Scotland Women lost their World Cup qualifier in Spain.
The 15-10 defeat in Madrid meant that the Scots lost out 25-15 on aggregate after two legs and miss out on going to the showpiece event in Ireland next year.
Head coach Shade Munro said: “It was a very good contest given the difficult conditions, both teams gave it everything.
“Spain were a bit more clinical and took their opportunities. They played most of the rugby in our half and put us under pressure and their scores ultimately came from that.
“We are disappointed, but all the very best to Spain for the World Cup.”
Spain scored first with an unconverted try in the eighth minute through winger Amaia Erbina. Nine minutes later the Scots bounced right back into things. Edinburgh University winger Lloyd took a great pass from centre Lisa Thomson to go over and it was 5-5.
Spain’s playmaker Patricia Garcia added her side’s second try on the half hour. Scotland’s second try came from Edinburgh University scrum-half Law who followed up her own grubber kick to go over. But, with 17 minutes to go, centre Marina Bravo scored the winning try.
Murrayfield Wanderers’ Luck Park earned a late Scotland debut off the bench.