South Africa and Sweden were involved in the very first piece of sporting action at this year’s Games, with the official opening ceremony only taking place on Friday.
But while Banyana battled hard and held their own for large parts of the match, they were undone by the conceding of a wasteful corner and then two errors within seconds from Barker which led to her scoring an own goal.
It was a deserved win for the Swedes, who dominated possession and chances, with Banyana showing plenty of skill, heart and organisation, but lacking any threat in the final third.
Sweden had an early chance when Sofia Jakobsson rattled the crossbar with Roxanne Barker well beaten inside five minutes.
South Africa were forced into a change on 40 minutes when Shiwe Nogwanya succumbed to what looked like an ankle injury and couldn't continue, with Linda Motlhalo her replacement.
There were no goals at the break as Sweden saw much more of the ball in the first half, but bar that early chance failed to unduly trouble Barker.
Banyana relied on counter-attack football, using their pace, but failed to have a shot on target in the opening half.
Olympic tournament page: All the news, fixtures, group standings
The pattern continued in the second half as Sweden continued to press, with Fridolina Rolfö firing over the bar with a vicious shot.
Just as South Africa started looking dangerous, Sweden finally went ahead on 75 minutes through a calamitous mistake from Barker.
She flapped at a corner-kick and when the ball came back into the six-yard box, fumbled again and this time spilled the ball into her own net.
Banyana tried to get back in the game but found creating clear-cut openings near impossible against the organised Swedes.
Sweden: Hedvig Lindahl, Linda Sembrant, Nilla Fischer, Magdalena Ericsson, Lisa Dahlkvist (Elin Blackstenius 46), Lotta Schelin, Kosovare Asllani, Sofia Jakobsson (Stina Blackstenius 69), Fridolina Rolfö (Olivia Schough 76), Jessica Samuelsson, Caroline Seger.
South Africa: Roxanne Barker, Lebohang Ramalepe (Sanah Mollo 82), Nothando Vilakazi, Noko Matlou, Janine Van Wyk, Mamello Makhabane, Stephanie Malherbe, Amanda Dlamini, Shiwe Nogwanya (Linda Motlhalo 40), Jermaine Seoposenwe, Refiloe Jane.