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
-
Delta Air Lines deploys new Airbus on Accra-New York route
1 min -
PPDC spearheads Africa’s AI development at DRIF24 forum
9 mins -
Ripoti App launched to empower journalists, others to tackle digital rights violations in Africa
25 mins -
Ground-breaking health investment charter to tackle worker shortages in Africa
30 mins -
From Mortuary to Matrimony: Feature on how couple’s love journey brewed at the morgue airs on Joy Prime
45 mins -
Ghana’s LPG prices rank among the highest globally – LPG Marketers Association
52 mins -
Filth Exhibition: Residents near Korle Gonno bear the brunt of nationwide filth
1 hour -
We’ve not selected NPP members as returning officers – EC replies Mahama
1 hour -
We’ll not honour any invitation – ECG tells Ashanti Regional Minister
2 hours -
Dumsor vigil to hit Accra
2 hours -
Supreme Court rule for dual citizens to hold other key positions laudable – Kwaku Asare
2 hours -
‘No one is above the law’ – CAF president on match-fixing allegations against Samuel Eto’o
2 hours -
Manchester City thrash Brighton to go second in table
3 hours -
NDC’s running-mate speech proves readiness to lead – Asah-Asante
3 hours -
Further win for nibima as another KNUST study supports medicinal prowess
3 hours