Winger George North scored two tries on his debut but it was not enough to give Wales victory against world champions South Africa.
First-half tries from teenager North and another score from James Hook gave the hosts an impressive 17-9 lead at half time but the Springboks hit back after the break.
South Africa responded with tries from Willem Alberts and Victor Matfield before North added his second of the match only to be denied a dream debut by the boot of Morne Steyn.
Wales have won just one of their 12 games against Tri-Nations opposition under coach Warren Gatland and their day got off to a terrible start from kick-off when Jonathan Thomas was turned over to gift Steyn an early penalty.
The home side responded immediately and were rewarded for choosing to boot a kickable penalty into touch when Stephen Jones’ pass found North unopposed to run in a debut try.
Wales extended their lead five minutes later making the most of an overlap out wide as Shane Williams accelerated through the South African line and found Hook who had a clear run to the line.
Jones secured the extras with his second conversion of the day before Steyn responded with his second penalty for the Springboks.
Fly-half Jones then made no mistake kicking over his first penalty after Deon Stegmann was penalised for an infringement at the ruck.
South Africa finished the first half the stronger and went in 17-9 after Steyn converted his third penalty of the afternoon.
Wales extended their lead through another Jones penalty shortly after the interval before Steyn kicked his fourth penalty to make it 20-12.
Substitute Alberts finally breached the Welsh line when he went over from close-range before the deadly Steyn added a superb conversion to take his side to within a point of Wales.
Captain Victor Matfield went over to mark his record-breaking 103rd cap after South Africa moved the ball quickly to expose Wales’ defence leaving Steyn to add the extras.
North scored his second try after collecting Jones’ cross field kick but after the fly-half missed the conversion, Steyn added a further penalty to see the Springboks through to victory.