A second penalty try for South Africa two minutes from full-time secured a nail-biting 31-30 victory over an unlucky Wales side who had looked set to claim their first ever away win over the Springboks in Nelspruit.
The tourists were the more physical and clinical team and forced South Africa into a host of soft errors in the second test.
Wales, who at one stage were down to 13 men, scored three tries through centre Jamie Roberts, wing Alex Cuthbert and hooker Ken Owens.
First-five Dan Biggar converted those and added three penalties.
South Africa's points came through the two penalty tries and further scores from wing Cornall Hendricks and Willie Le Roux.
First-five Morne Steyn booted four conversions and a penalty.
Wales managed to keep the Springboks at bay until two minutes from the end when Hendricks burst down the right and, just as he was about to touch down, was barged into touch by fullback Liam Williams.
Another video review was called and it was ruled that Williams had not used his arms in the tackle, leading to the second penalty try and Steyn kicking the winning conversion.