Alvaro Morata's late goal helped Spain qualify for the 2022 World Cup and consigned Sweden to the play-offs.
Sweden goalkeeper Robin Olsen tipped Dani Olmo's shot on to the crossbar with Morata on hand to tap the ball in after 86 minutes.
Luis Enrique's side needed just a point to top Group B while Sweden needed to win to finish above their opponents.
The result means Spain have qualified for a 12th consecutive World Cup finals.
Sweden will have another chance to reach Qatar in the European play-offs in March.
Spain started the brighter with winger Pablo Sarabia curling an effort narrowly wide from 20 yards in the opening exchanges.
The visitors grew into the match and had a number of chances in the first half with forward Emil Forsberg twice going close to breaking the deadlock.
And Alexander Isak should have put Janne Andersson's side in front when through on goal midway through the second period, but the forward snatched at his chance after capitalising on some lapsed defending.
Spain held on after taking a late lead and keep up their run of reaching every World Cup since 1974.
Latest Stories
-
Meet Fred Amugi’s 100-year-old mother
16 mins -
Brazil great Marta to retire from international duty
53 mins -
Otto Addo was forced to accept Black Stars coaching job – Mohammed Polo
58 mins -
Karim Zito qualified to be Black Stars head coach – Mohammed Polo
1 hour -
Platinum Cup makes return on April 27
1 hour -
MoE is not changing uniforms or re-painting all public schools – Kwasi Kwarteng clarifies
2 hours -
16th Africa Aquatics Swimming Championships: Nubia and Harry to represent Ghana in Angola
2 hours -
Four defendants in NDA case by OSP open defence today
2 hours -
GFA commissions first set of floodlights at Ghanaman Soccer Centre of Excellence
2 hours -
Basic public school uniform change an initiative, not a policy – Kwasi Kwarteng
2 hours -
Bawumia appeals for peace in Gonjaland, donates GHȼ100K, bull
2 hours -
Drake: AI Tupac track gone from rapper’s Instagram after legal row
2 hours -
Repainting schools, changing uniforms a misplaced priority – Joy FM listeners on rebranding of basic public schools
2 hours -
UEFA U-16 Tournament: Black Starlets bounce back with 5-1 win over Serbia
3 hours -
There’s nothing strange about changing colours for basic public schools – Education Ministry PRO
3 hours