Bok skipper Fourie du Preez scored the match-winning try with five minutes remaining to break Welsh hearts as the Springboks recorded a 23-19 victory in London.
Both teams registered a try each in an attritional game highlighted by Wales’ magnificent defence.
Dan Biggar set-up his sides only try, scored by Gareth Davies, and kicked 14 points. South African flyhalf Handre Pollard kicked 18 points including five penalties and a drop goal.
Wales completed 189 tackles to the Boks' 101 despite conceding territory and possession in the second half but it was not enough.
Pollard put the Boks 6-0 ahead with two penalties after George North went off his feet in the ninth minute and Alun-Wyn Jones was pinged three minutes later.
Referee Wayne Barnes was strict at the breakdown and after 15 minutes the Englishman had blown for five penalties - 12 in total in the first half and 11 at the breakdown.
"Beast" Mtawarira was the next guilty party and Biggar reduced the deficit by three before Pollard again extended the Springbok lead to six with his third penalty.
The game-plans were clear: play in the opposition’s half using up-and-unders and cross-kicks.
Wales’ kicking was causing problems for the Bok back three and on 18 minutes the pressure told.
Biggar caught a high-ball inside his half, launched a high-kick of his own, beat Willie Le Roux, regathered and passed to the on-rushing Davies to score the games opening try.
The flyhalf added the easy conversion and Wales had a 10-9 lead. Luke Charteris was then penalised for obstruction, 12-10 at the end of the first quarter.
The Test was tight and the team that reduced their penalty count would come out on top.
Biggar kicked a drop goal on the stroke of half-time to give Wales a one-point lead.
Pollard missed a relatively simple penalty attempt early in the second half after the Boks ferocious driving maul.
It would prove costly as Biggar extended Wales lead when Schalk Burger went offside, 16-12.
The Springboks ill-discipline was haunting them, their play static and uninspired. The red tide of Welsh defenders never looked like being breached.
The Boks bashed at the Welsh line but could not get through. After multiple phases with no success the 21-year-old stand-off kicked a drop goal of his own to reduce the gap to a point after 53 minutes.
A bit of aerial ping-pong ensued after the restart - a line-out to South Africa who in turn set up a driving maul and won a penalty.
Again Pollard missed, 16-15 to Wales as Warren Gatland started to empty his bench.
The Boks were however, starting to dominate possession and territory. They almost scored after Le Roux broke through the midfield, but some more handling errors from the Boks meant it ended in a turnover.
With 20 minutes to play South Africa won a penalty, Pollard squeezed the ball inside the right-hand up-right and the Boks were back in front 18-16.
Wales hit back immediately when they spoiled a Springbok ruck. Biggar made no mistake to put his team a points to the good.
The Boks kept coming but to no avail as an ineffective attack ran up too many blind alleys. This was a stunted performance by Heyneke Meyer’s team.
Then bang. South Africa were awarded a scrum deep inside the Welsh 22m. The Bok front-row wheeled the set-piece allowing Duane Vermeulen to pick up at the base and break blind.
The No 8 gave a wonderful off-load out the 'back-door' to his captain who beat Alex Cuthbert to score the match-winning try. Pollard missed the conversion.
Pat Lambie missed an attempted drop goal to give Wales possession in the dying moments but the Springboks held out for the win.
Final Score South Africa 23 (12) Wales 19 (13)
Tries - Du Preez
Pen - Pollard (5)
Drop - Pollard
Tries - Davies
Pen - Biggar (3)
Con - Biggar
Drop - Biggar
Referee: Wayne Barnes (ENG)
Assistant referees: George Clancy (IRE), JP Doyle (ENG)
TMO: Graham Hughes (ENG)
15 Willie le Roux, 14 JP Pietersen, 13 Jesse Kriel, 12 Damian de Allende, 11 Bryan Habana, 10 Handré Pollard, 9 Fourie du Preez (captain), 8 Duane Vermeulen, 7 Schalk Burger, 6 Francois Louw, 5 Lodewyk de Jager, 4 Eben Etzebeth, 3 Frans Malherbe, 2 Bismarck du Plessis, 1 Tendai Mtawarira.
Replacements: 16 Adriaan Strauss, 17 Trevor Nyakane, 18 Jannie du Plessis, 19 Pieter-Steph du Toit, 20 Willem Alberts, 21 Ruan Pienaar, 22 Pat Lambie, 23 Jan Serfontein.