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
-
PSG clinch Ligue 1 title after Lyon’s win over Monaco
15 mins -
Guinness Ghana sets the pace at Ghana Beverage Awards with six awards
36 mins -
Burkina Faso suspends BBC, VOA radio broadcasts over killings coverage
41 mins -
Nicole Kidman honoured with AFI Life Achievement Award
53 mins -
Brassier scores winner for Brest as they edge Rennes to secure European football
1 hour -
Ejisu by-election: Akufo-Addo jabs independent candidate; refutes allegations to rig elections
2 hours -
‘What are the real causes of the erratic power outages?’ GUTA demands from ECG
2 hours -
Implementing ESG framework in Ghana’s energy sector for sustainability
2 hours -
CAFCC: Dreams FC exit competition after 3-0 defeat in Kumasi
2 hours -
The detrimental effects of political interference on Ghana’s electricity sustainability
2 hours -
Prof. Opoku-Agyemang’s appointment as running mate intimidates the NPP – Benjamin Quashie
2 hours -
Black Stars physical trainer dead
2 hours -
Bawumia to kick off nationwide campaign for Election 2024 tomorrow
2 hours -
GUTA charges ECG to provide ‘dumsor’ timetable for businesses to plan
2 hours -
Reason for training professional counsellors is to heal a hurting world – CCP president
5 hours