Spain sealed qualification for Euro 2020 with two games to spare on Tuesday after Rodrigo Moreno came off the bench to score a dramatic injury-time equaliser in a 1-1 draw with Sweden.
The 2008 and 2012 European champions needed only a point in Stockholm to guarantee automatic progress to the finals. Rodrigo ensured they got it, after Marcus Berg had headed Sweden into the lead early in the first half.
Rodrigo's 92nd-minute tap-in sparked jubilant celebrations on the touchline. It provided a dramatic conclusion to an otherwise fairly smooth campaign for Robert Moreno, who took over in June following the resignation of Luis Enrique.
"Qualification is a must for a team like Spain but achieving it still has value," said Moreno. "It releases the pressure and gives us time to work."
After drawing their last two matches, Spain are top of Group F on 20 points, five ahead of Sweden and six above Romania, who missed the chance to take second spot when Norway's Alexander Sorloth snatched a last-ditch 1-1 draw in Bucharest.
Finishing ahead of Sweden, Romania and Norway offers only a limited idea of how Spain will fare against Europe's elite.
There remain several question marks over key positions, not least in goal, where David de Gea started but was forced off injured in the second half, a worry for his club Manchester United ahead of their meeting with Premier League leaders Liverpool this weekend.
De Gea appeared to have pulled a muscle in his right leg after making a clearance and was replaced by Chelsea's Kepa Arrizabalaga, who had started Saturday's 1-1 draw Norway.
"He said at half-time he wanted to continue," Moreno said. "It's a pull in his adductor. We will have to assess the damage."
Suspensions for Sergio Ramos and Sergio Busquets meant there was not a single player in the starting line-up who had played in the Euro 2008 and 2012 triumphs, or the World Cup in between.
Moreno is furthering Spain's attempt to usher in a new era. Barca's 16-year-old sensation Ansu Fati could be an option against Malta and Romania next month.
Fati became the second youngest player to represent Spain under-21s on Tuesday night, coming on for the final 10 minutes of Spain's 2-0 win over Montenegro.
For the senior side, Villarreal's Gerard Moreno made his debut up front. Rodri and Inigo Martinez came in for the banned Ramos and Busquets.
Spain made a strong start and should have taken the lead when Thiago Alcantara had only the keeper to beat, but failed either to finish or find Mikel Oyarzabal waiting for a tap-in inside him.
Rodri and Moreno both went close but Sweden survived and then grew into the game, breaking Spain's rhythm and creating chances of their own.
De Gea made a brilliant diving save to stop Robin Quaison's header flying into the top corner. Then a neat touch from Berg set up Emil Forsberg who grazed the post.
Sweden stayed in the ascendancy after half-time and broke through in the 50th minute. De Gea palmed away Berg's header and then rose to deny Forsberg on the rebound but the ball spun up from his second save and Berg was well-placed to nod in the opener.
Kepa replaced the limping De Gea on the hour.
Spain had some joy from crosses, with Moreno and Oyarzabal both going close. But it looked like Sweden would hold on until Rodrigo, on for Thiago, struck.
Alexander Isak's clearance only fell to the feet of Fabian Ruiz at the back post and he took a touch before lashing his shot across goal. Rodrigo, three yards out, could not miss.
Stockholm, Sweden | AFP