South Africa's Grand Slam trail began with a narrow win in a pulsating game at Cardiff's Millennium Stadium.
Tries from Jaco van der Westhuyzen and Joe van Niekerk helped the Boks to an early 23-6 lead, but a Schalk Burger sin-binning aided a Wales fightback.
A Gavin Henson try and Stephen Jones (21 points) brought it to 23-22, before Jean de Villiers and Percy Montgomery (23 points) took the Boks away.
Henson got his second, then Dwayne Peel crossed with the last move of the game.
It was a nightmare start for the home side, the Springboks' superior physical presence at the breakdown forcing a Wales
offence, Montgomery landing a first-minute penalty.
The visitors' forwards were delivering perfect ball, with the outstanding Victor Matfield to the fore, and when Marius Joubert played a neat switch in midfield he found himself in acres of space.
Hal Luscombe managed to scythe the centre down yards from the line, but it was quickly recycled to van der Westhuyzen
who crossed in the corner.
Wales responded with some heavy tackling and good driving play, Luscombe again prominent, and were rewarded with two
Stephen Jones penalties against one from Montgomery.
But when Michael Owen spilt attacking ball, Newport-based Montgomery quickly punished his adopted country, bursting through a
weak Colin Charvis tackle.
After a 60-yard run Montgomery played a one-two with De Wet Barry before sending the supporting van Niekerk in for the
Neither side shirked the physical exchanges
Montgomery and Jones exchanged penalties as referee Paddy O'Brien repeatedly blew up for handling at the ruck, and on the
stroke of half-time Springbok flanker Burger was yellow carded for his third offence.
Jones landed the goal, and added another soon after the break when a superb Peel break forced van Niekerk into a
cynical offence to deny a try.
The visitors were shaken further as Dafydd Jones stole maul ball deep in their half before rumbling over the top of
Quick ball came back to Henson who side-stepped over, Jones' conversion bringing Wales to within a point.
South African discomfort was short-lived, a great midfield break sending De Wet Barry on a 50-yard run, only for the centre
to be superbly held up over the line by Wales captain Gareth Thomas.
From the resulting scrum, Joubert sent a neat inside pass to replacement de Villiers, who restored South Africa's
comfort zone with a converted try.
The game was getting loose, and when Shane Williams spilled the ball under a heavy Bakkies Botha tackle it came to van der
Westhuyzen on the wing.
His burst for the line was denied by Henson, but the fly-half fed inside to Montgomery for a simple try.
Wales brought on fresh legs, and after good work from the forwards Sonny Parker fed Henson in the corner for his second try.
Then, with the last move of the match, the mighty Springbok scrum was destroyed by tight-head Adam Jones, their defensive set-piece sent into disarray and allowing Peel to sneak over for a memorable, if ultimately worthless, score.
Wales: G Thomas (Toulouse, capt); H Luscombe (Dragons), S Parker (Ospreys), G Henson (Ospreys), S Williams (Ospreys); S Jones (Clermont-Auvergne), D Peel (Scarlets); D Jones (Ospreys), S Jones (Dragons), A Jones (Ospreys), B Cockbain (Ospreys), M Owen (Dragons), D Jones (Scarlets), C Charvis (Newcastle), R Jones (Ospreys).
Replacements: M Davies (Neath), G Jenkins (Blues), L Charteris (Dragons), M Williams (Blues), M Phillips (Scarlets), C Sweeney (Dragons), T Shanklin (Blues).
South Africa: P Montgomery (Dragons); B Paulse (Western Province), M Joubert (Western Province), De Wet Barry (Western Province), A Willemse (Lions); J van der Westhuyzen (NEC), F du Preez (Blue Bulls); Os du Randt (Free State Cheetahs), J Smit (Natal Sharks), E Andrews (Western Province), B Botha (Blue Bulls), V Matfield (Blue Bulls), S Burger (Western Province), J Smith (Free State Cheetahs), J van Niekerk (Western Province).
Replacements: H Shimange (Western Province); CJ van der Linde (Free State), G Britz (Free State Cheetahs), T Dlulane (Pumas), M Claassens (Free State Cheetahs), J de Villiers (Western Province), B Russell (Natal).
Referee: Paddy O'Brien (New Zealand)