Spain's 1-0 win over Norway on Sunday evening has seen La Roja qualify for Euro 2024 from Group A, while the result has also allowed Scotland to advance to the finals from the same section.
Scotland suffered a 2-0 defeat to Spain on Thursday evening, with Scott McTominay controversially having a goal disallowed before Alvaro Morata and Oihan Sancet netted for the hosts late on.
The result meant that Spain needed one more win to advance to the European Championship, and they were able to claim it on Sunday by beating Norway 1-0 courtesy of a strike from Gavi.
Spain had a goal disallowed in the 20th minute of the contest, but Gavi netted shortly after the interval, and Norway were unable to launch a response despite having a certain Erling Haaland in their side.
La Roja suffered a surprise 2-0 loss to Scotland in their second match in the group, but four straight wins have now moved them onto 15 points at the head of the section.
Scotland were looking from a favour from Spain on Sunday and it came, with Steve Clarke's side fully deserving of their spot in the finals due to their strong performances in the section.
Spain will now finish their campaign with matches against Cyprus and Georgia next month, while the pressure is off Scotland ahead of their final two matches with Georgia and Norway.
Scotland have qualified for the finals of a European Championship for just the fourth time in their history, with their three previous tournaments seeing them knocked out in the group stage.
Spain, though, are three-time winners of the competition, while they made the semi-finals of Euro 2020.