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
-
Dreams FC denies allegations of attempting to sign Najeeb Yakubu
2 mins -
Election 2024: ‘Right to free and fair elections non-negotiable’ – Akufo-Addo
7 mins -
Kurt Okraku took out my passport from the U23 squad that travelled to Japan – Najeeb Yakubu alleges
17 mins -
Where hope fails: Ghana’s decaying home for the destitute
27 mins -
NDC Mining Committee for 2024 campaign refutes allegations of recruiting thugs for elections
38 mins -
Traction Control: A lifesaver with an off switch? Here’s why it exists
41 mins -
I don’t need anyman to woo me with money – Miss Malaika 2024 winner refutes pimping claims
48 mins -
”Kurt Okraku sabotaged my national team career because I refused to sign with Dreams FC” – Najeeb Yakubu
49 mins -
Businesses urged to leverage Generative AI for enhanced customer engagement
53 mins -
MultiChoice Ghana partners with Ghana Hotels Association to elevate guest entertainment
1 hour -
Bawumia’s music streaming app or Mahama’s pay-per-view TV channel?
1 hour -
Karpowership Ghana empowers 40 Takoradi Technical University students with scholarship
1 hour -
We expect significant reduction in prices of petroleum products in coming weeks – CEO AOMC
1 hour -
Betway Africa offers once-in-a-lifetime ‘Play-on-the-Pitch’ experience at Emirates Stadium
2 hours -
I coined the term ‘hype man’ in Ghana – Merqury Quaye
2 hours