Dragons full-back Percy Montgomery did the damage for the visitors with 23 points as South Africa began their tour of the British Isles with a win.
In front of a crowd of just over 55,000 at the Millennium Stadium, the Springboks struck first in the opening minute via a Montgomery penalty after Wales had strayed offside.
After that early breakthrough the reigning Tri-Nations champions were quickly into their stride with Wales spending much of the early period penned in their own half.
South Africa moved further ahead after seven minutes with an outstanding try. Centre Marius Joubert made an incisive 25-metre break only to be held up just short of the line, but the Springboks recycled the ball quickly and scrum-half Fourie du Preez found half-back partner Jaco van der Westhuyzen who scored in the corner. Montgomery added a difficult conversion to put the visitors 10-0 up.
Wales put their first points on the board with a Stephen Jones penalty four minutes later but Montgomery quickly added his second penalty of the game to restore South Africa’s 10-point advantage.
Jones then responded with his second penalty to keep Wales in touch but it proved a brief respite as South Africa scored their second try midway through the first half when another sparkling move engineered by Montgomery and centre De Wet Barry was finished off by number eight Joe van Niekerk.
Montgomery was bang on target with the conversion and then added a penalty to put Jake White’s side 23-6 ahead.
Another penalty from the ever-reliable Jones proved a brief respite from the onslaught but the Springboks remained firmly in control for the remainder of the first half as they dominated possession up front and their backs continued to look threatening with the wealth of quality ball coming their way.
However, South Africa were reduced to 14 men when Schalk Burger was sin-binned for 10 minutes after being penalised for diving over the top.
Jones kicked his fourth penalty of the game on the stroke of half-time and a moment of individual brilliance from Dwayne Peel early in the second half almost led to a Welsh try as only a last-ditch tackle from Joubert denied him.
But Wales did cut the deficit to eight points thanks to Jones’ close-range penalty and then moved back to within touching distance after 47 minutes with a fine try from centre Gavin Henson which was converted by Jones to leave the Springboks ahead by just 23-22.
Wales looked on the brink of pulling off a huge shock but a rattled South Africa regained the initiative when replacement winger Jean de Villiers touched down and Montgomery again booted the conversion to put the Boks 30-22 ahead with 20 minutes remaining.
And they made sure of victory when a wonderful break from van der Westhuyzen created a try for Montgomery who was wide of the target with the conversion attempt.
Montgomery kicked another penalty with eight minutes remaining as the Springboks recorded their highest points total against Wales in Cardiff, surpassing the 37 points they scored in 1996.
Wales did have the final say though as Henson grabbed his second try of the match and Peel also scored. Jones converted both to take his personal tally to 21 points.
Scorers:
Wales – Tries: Gavin Henson (2), Dwayne Peel
Conversions: Stephen Jones (3)
Penalties: Stephen Jones (5)
South Africa – Tries: Jaco van der Westhuyzen, Johann van Niekerk, Jean de Villiers, Percy Montgomery
Conversions: Montgomery (3)
Penalties: Montgomery (4)
Teams:
Wales: Thomas; Luscombe, Parker, Henson, S Williams; S Jones, Peel; D Jones, S Jones , A Jones; Cockbain, Owen; D Jones, Charvis, R Jones
Replacements: Davies, Jenkins, Charteris, M Williams, Phillips, Sweeney, Shanklin
South Africa: Montgomery; Paulse, Joubert, De Wet Barry, Willemse; van der Westhuizen, du Preez; Os du Randt, J Smit, E Andrews; Botha, Matfield; S Burger, Smith, van Niekerk
Replacements: Shimange, van der Linde, Britz, Dlulane, Claassens, de Villiers, Russell
Referee: Paddy O’Brien (New Zealand)