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
-
From Gold Coast Ghana to Gold Cost Ghana?
15 mins -
There hasn’t been enough awareness about new curriculum – Parent
18 mins -
betPawa to invest GH¢7m into Ghana Premier League and Women’s FA Cup in 5yrs
23 mins -
Child poverty can be addressed with the right priorities and policies – UNICEF
23 mins -
Ghana’s exchange rate problems need more than gold purchases – IMANI
29 mins -
IMANI calls for review of Ghana’s procurement law to enhance transparency
29 mins -
Women in Worship organisers mad at Nigeria’s Ada Ehi over ‘no show’
30 mins -
Everything is more difficult now – Guardiola
35 mins -
Mahama will make the economy viable for the youth to become entrepreneurs – Osman Ayariga
40 mins -
East Legon crash: Police pursue TikTokers for ‘false claims’ about Salifu Amoako’s son’s location
1 hour -
Severe food shortage force some SHSs to serve repetitive meals
1 hour -
Don Julio 1942 launched by Guinness Ghana Breweries with an enchanting Halloween Ball celebration
1 hour -
3 Central Region MCEs intensify cholera control efforts after 5 deaths
1 hour -
Bawumia’s 12 ‘Bold Steps’ to expand educational opportunities for all
1 hour -
Mahama criticises NPP for accumulating energy debt to pass on to next NDC gov’t
1 hour