Amanda Ilestedt scored a last-minute winner as Sweden beat South Africa at the Fifa Women's World Cup in Wellington.
The 2022 Africa Cup of Nations champions came close to picking up their first point at a World Cup, having lost all three matches on their only previous appearance in 2019.
South Africa opened the scoring with a 48th-minute goal from Hildah Magaia, but it was cancelled out by a deflected Frida Rolfo effort before Ilestedt's decisive header.
Sweden top Group G, with Argentina and Italy to meet on Monday.
South Africa almost opened the scoring when captain Refiloe Jane saw Sweden goalkeeper Zecira Musovic off her line and attempted an audacious strike from 40 yards out, with the ball ending up on the roof of the net.
While Desiree Ellis' side impressed on the counter-attack, Sweden - ranked third in the world - struggled to create clear-cut chances, and Filippa Angeldal forced the only save from Kaylin Swart in the first half with a tame effort from a free-kick routine.
South Africa raced out of the blocks after the break, finding the opener when Musovic could only parry Thembi Kgatlana's deflected shot into the path of Magaia, who ran the ball into the net for her nation's second World Cup goal.
Magaia was absent from her team's celebrations, injuring herself as she bundled the ball into the net, and was substituted shortly after.
As Sweden committed more players forward in search for an equaliser, South Africa enjoyed more counter-attacking opportunities and continued to look the more threatening side.
But their hard work was cancelled out when Rolfo's touch from Johanna Kaneryd's cross was deflected by Lebohang Ramalepe into her own goal.
Peter Gerhardsson's side continued to push forward but were denied by solid South Africa defending until Kosovare Asllani's corner was met by Ilestedt with a strong header.
helpHow to play
Rate players out of 10 throughout or after the game. The rater will close 30 minutes after the final whistle.
Rating range key1 = Give it up10 = Pure perfection
Sweden
Squad number1Player nameMusovic
Squad number14Player nameBjörn
Squad number13Player nameIlestedt
Squad number6Player nameEriksson
Squad number19Player nameRytting Kaneryd
Squad number16Player nameAngeldahl
Squad number23Player nameRubensson
Squad number2Player nameAndersson
Squad number9Player nameAsllani
Squad number18Player nameRolfö
Squad number11Player nameBlackstenius
Squad number8Player nameHurtig
Squad number15Player nameBlomqvist
Squad number17Player nameSeger
Squad number20Player nameBennison
Squad number22Player nameSchough
South Africa
Squad number1Player nameSwart
Squad number2Player nameRamalepe
Squad number13Player nameMbane
Squad number3Player nameGamede
Squad number18Player nameHolweni
Squad number12Player nameSeoposenwe
Squad number15Player nameJane
Squad number19Player nameBiyana
Squad number8Player nameMagaia
Squad number10Player nameMotlhalo
Squad number11Player nameKgatlana
Squad number9Player nameSalgado
Squad number22Player nameKgoale
Line-ups
Sweden
Formation 3-4-2-1
1Musovic
14Björn13Ilestedt6Eriksson
19Rytting Kaneryd16Angeldahl23Rubensson2Andersson
9Asllani18Rolfö
11Blackstenius
1Musovic14Björn13Ilestedt6Eriksson19Rytting KanerydSubstituted forHurtigat 88'minutes16AngeldahlSubstituted forBennisonat 67'minutes23RubenssonSubstituted forSegerat 81'minutes2Andersson9Asllani18RolföSubstituted forSchoughat 67'minutes11BlacksteniusSubstituted forBlomqvistat 67'minutesSubstitutes
3Sembrant4Lennartsson5Sandberg7Janogy8Hurtig10Jakobsson12Falk15Blomqvist17Seger20Bennison21Enblom22SchoughSouth Africa
Formation 4-4-2
1Swart
2Ramalepe13Mbane3Gamede18Holweni
12Seoposenwe15Jane19Biyana8Magaia
10Motlhalo11Kgatlana
1Swart2Ramalepe13Mbane3Gamede18Holweni12Seoposenwe15JaneBooked at 89mins19BiyanaBooked at 74mins8MagaiaSubstituted forSalgadoat 56'minutes10MotlhaloSubstituted forKgoaleat 67'minutes11KgatlanaSubstitutes
4Matlou5Magama6Cesane7Dhlamini9Salgado14Makhubela16Dlamini17Kgadiete20Moodaly21Moletsane22Kgoale23ShongweLive Text
Match ends, Sweden 2, South Africa 1.
Second Half ends, Sweden 2, South Africa 1.
Attempt saved. Caroline Seger (Sweden) header from the centre of the box is saved in the centre of the goal. Assisted by Jonna Andersson with a cross.
Corner, Sweden. Conceded by Nomvula Kgoale.
Corner, Sweden. Conceded by Nomvula Kgoale.
Attempt blocked. Jonna Andersson (Sweden) left footed shot from the centre of the box is blocked. Assisted by Rebecka Blomqvist.
Rebecka Blomqvist (Sweden) wins a free kick on the left wing.
Foul by Lebohang Ramalepe (South Africa).
Attempt saved. Bambanani Mbane (South Africa) header from the centre of the box is saved in the bottom right corner. Assisted by Nomvula Kgoale with a cross.
Corner, South Africa. Conceded by Nathalie Björn.
Attempt blocked. Thembi Kgatlana (South Africa) left footed shot from the centre of the box is blocked. Assisted by Refiloe Jane.
Foul by Rebecka Blomqvist (Sweden).
Lebohang Ramalepe (South Africa) wins a free kick in the defensive half.
Attempt missed. Nomvula Kgoale (South Africa) right footed shot from outside the box misses to the left. Assisted by Thembi Kgatlana.
Goal! Sweden 2, South Africa 1. Amanda Ilestedt (Sweden) header from very close range to the centre of the goal. Assisted by Kosovare Asllani with a cross following a corner.
Corner, Sweden. Conceded by Bambanani Mbane.
Refiloe Jane (South Africa) is shown the yellow card for a bad foul.
Caroline Seger (Sweden) wins a free kick in the defensive half.
Foul by Refiloe Jane (South Africa).
Substitution, Sweden. Lina Hurtig replaces Johanna Rytting Kaneryd.