Australia had South Africa on the ropes with bat and ball in Durban, but twice allowed the game to escape them as the hosts claimed a 67-run victory in the first ODI on Thursday.
South Africa were in trouble early in their innings before recovering to post 297-8, while Australia raced to 90 without loss in just 9.2 overs in reply.
Neither advantage proved enough.
Australia eventually lost all 10 wickets for just 140 more runs, turning a dominant start into a heavy defeat and giving South Africa an early advantage in the three-match series.
South Africa recover after Australia take control
Australia's bowlers had put the hosts under pressure early, but South Africa rebuilt their innings before accelerating late.
They scored close to 100 runs in the final 10 overs to reach a total that initially looked well within Australia's reach.
Captain Mitch Marsh acknowledged that Australia had been unable to prevent the late surge despite recognising where the danger lay.
"They got 100 runs off the last 10 overs," Marsh said.
"They like to build in their 50 overs and then go hard in the last 10 or 15. We pushed to try and get an extra couple of wickets to prevent that, but it didn't go our way.
"Credit where it is due, they did well to get close to 300 on that wicket."
South Africa defend their total, bowling Australia out for 230 to secure a 67-run victory in the first ODI. 💪🇿🇦
A brilliant all-round team performance to start the series!
#Unbreakable

Australia's response could hardly have started better, reaching 90 without loss inside 10 overs and appearing to have control of the chase.
Instead, the innings unravelled and the tourists were eventually dismissed after adding only another 140 runs.
Australia face important lessons ahead of 2027
The result continues a difficult recent record for Australia against South Africa in ODIs.
In their previous 24 meetings since September 2016, Australia had won five and South Africa 18, with one match abandoned.
That record makes the current series particularly useful for Australia, with the 2027 World Cup set to be staged in South Africa, Namibia and Zimbabwe around this time next year.
The three matches therefore offer Australia valuable experience of the conditions and opposition they could encounter when the World Cup arrives.
But Thursday's defeat also highlighted the importance of converting strong positions into results.
Australia had South Africa under pressure with the ball before conceding a late surge, then produced a blistering start to their chase only to lose all 10 wickets for 140 runs.
South Africa, by contrast, recovered from their own difficult position and finished strongly enough to turn those missed opportunities into a convincing win.