Teenager George North scored two tries on his Test debut, but Wales blew another golden opportunity to claim a coveted Tri Nations scalp.
The 18-year-old giant Scarlets wing, who has already been dubbed the Welsh Jonah Lomu, matched his billing with a barnstorming display.
Centre James Hook also breached South Africa's defence and fly-half Stephen Jones kicked 10 points, yet Wales unforgivably surrendered a 20-9 lead established after 47 minutes.
The Springboks, who launch their World Cup defence against Wales in New Zealand next September, fought back from the abyss through second-half tries from skipper Victor Matfield and replacement Willem Alberts.
Goalkicker Morne Steyn, scourge of the British and Irish Lions in South Africa last year, added 19 points through five penalties and two conversions and Wales were left to reflect on a 12th successive defeat against the Springboks.
It was also their 11th loss in 12 starts against Tri Nations opposition under coach Warren Gatland, and while Wales will take heart from a thrilling first-half display, they painfully came up short.
Gatland's men will wonder how they conceded 17 unanswered points during nine minutes of mayhem, and although the 20,000 fans who stayed away from the Millennium Stadium –
Wales were watched by under 55,000 for a second successive week - missed a thriller, it was South Africa who ultimately prevailed.
Gatland admitted there had been a degree of disruption caused by injuries to prop Gethin Jenkins (calf muscle) and flanker Dan Lydiate (ankle), whose withdrawals were announced an hour before kick-off.
Paul James took Jenkins' place, with Powell replacing Lydiate, while Matfield set a new South African Test appearance record by winning his 103rd cap, nudging ahead of John Smit and Percy Montgomery.
Wales, despite conceding a penalty to Steyn inside 60 seconds, made their intentions clear immediately through an all-out attacking approach that brought a glorious reward.
The home side sacrificed a kickable sixth-minute penalty, booted possession into touch instead, and then Jones found North on a blistering angle after centre Tom Shanklin's decoy run disrupted South Africa's defence.
It was an unforgettable start to North's international career, and with Jones adding the conversion Wales were good value for a 7-3 lead as the Springboks looked to regroup.
But Wales had other ideas and they struck another stunning blow just 11 minutes later after Byrne attacked from deep inside his own half and linked with North.
South Africa were slow to halt North's progress and then had no answer as slick midfield
passing freed wing Shane Williams at pace, before the supporting Hook galloped over unopposed.
Jones again converted and although Steyn slotted his second penalty, Wales ended the opening quarter 14-6 up, having completely dictated the tempo of an electric opening.
South Africa were pinned inside their own half, starved of quality possession and forced into a prolonged defensive rearguard as Wales unleashed wave after wave of runners at them.
A Jones penalty increased the advantage to 17-6, and it was almost error-free rugby by Wales played at a relentless pace and underpinned by fearless commitment.
Even when the Springboks got their hands on the ball they were stopped at source, and there could be no complaints from the visitors - despite a third Steyn penalty - as they trooped off with a second-half mountain to climb.
Wales lost an injured Shane Williams at the break - he suffered what appeared to be a wrist injury following a Francois Steyn tackle - and the Ospreys speedster was replaced by Chris Czekaj.
But the home side quickly regained their momentum and impressive approach work by flankers Powell and Martyn Williams created a platform from which Jones landed his second penalty.
Steyn cancelled that strike out and then an inspired substitution saw Alberts claim a try just four minutes after going on for Deon Stegmann.
Steyn converted and Wales were at sixes and sevens, which was illustrated when South Africa scored from their next attack through the imperious Matfield.
With Steyn again adding the extras, Wales had gone from 11 points up after 47 minutes to 26-20 down before North's second try - when he collected a Jones cross-kick on the bounce - brought them back within a point.
Another Steyn penalty increased South Africa's lead, but Wales finished the match camped just metres from South Africa's line, rumbling on through their forwards for repeated phases before the Springboks finally - and with a huge sigh of relief - shut up shop.