The Official Online RBS 6 Nations Store is open. The store has everything you need to get behind your team during the RBS 6 Nations, plus the store is now fully stocked with a much wider range of rugby merchandise.
Wing Leigh Halfpenny also kicked a penalty for Wales, but de Villiers and his fellow centre Adrian Jacobs scored tries for the visitors - with Ruan Pienaar slotting 10 points.
A second Hook penalty reduced the gap to 11 points, and Wales sensed they could claw their way back.
That optimism increased with 18 minutes left, after Springboks substitute Jaque Fourie was sin-binned for killing possession.
Hook kicked the resulting penalty, and Wales knew they had to make a temporary one-man advantage count as South Africa displayed increasing signs of frustration.
A bloodied Smit then left the action to be replaced by Brian Mujati, and Wales found themselves engaged in a prolonged period of defending as South Africa kept possession at close quarters.
Another Hook penalty, which bounced over off the post, made it 20-15 - setting up a frenzied final seven minutes.
It was all Wales, as they camped inside South Africa’s 22 looking for a foothold to launch a try-scoring attack.
They had to remain patient, but South Africa called on all their experience - they were also helped by a Byrne defensive blunder - to stay ahead.
It was South Africa’s 10th successive victory over Wales.