Wales ended their autumn international series with a comfortable win over disorganised South Africa at the Principality Stadium.
Hooker Ken Owens’ try from a lineout rumble in the 44th-minute opened a 14-point gap before Springbok flanker Uzair Cassiem hit back.
Justin Tipuric’s try clinched only a third-ever win over the Springboks.
The defeat means South Africa have lost eight times in a calendar year for the first time in their history.
Watch: Wales 27-13 South Africa – the best of the action
Leigh Halfpenny kicked 17 points as Wales clinched three November wins for the first time since 2002.
The 14-point winning margin was a record for Wales against South Africa, beating the 10-point gap in the 29-19 victory in 1999 when interim coach Rob Howley was captain.
Wales looked comfortable at 20-6 five minutes into the second half, but the mistake-prone Springboks rallied through their forwards to put pressure on Howley’s team.
But when Tipuric ran onto a short pass from Taulupe Faletau and swerved past the last defender with four minutes remaining the game was safe.
South Africa were a pale shadow of the team that knocked Wales out of the World Cup in October 2015, and coach Allister Coetzee will face a major inquest on his return home.
Wales dominated for long periods without making South Africa pay for their many mistakes.
Visitors fly-half Elton Jantjies, in particular, had an accident-prone game, yet Wales looked to be lacking in confidence in attack.
Coach Howley, in charge while Warren Gatland prepares for the British and Irish Lions tour to New Zealand next summer, will be relieved by the final score.
South Africa started brightly with Francois Venter and Rohan Janse van Rensberg making early inroads.
But after Jantjies gave them a seventh-minute lead, Wales took control, aided by some chaotic handling and poor decision-making by the Springboks.
Apart from a burst down the left by Jonathan Davies, the home side did not really ask serious questions of their visitors. Their territorial advantage, though, yielded four penalties for the immaculate boot of Halfpenny.
When Owens rounded off a forward drive early in the second half with South Africa scrum-half Faf de Klerk in the sin-bin, things finally looked rosy for Wales.
The Springboks were then let off the hook and when Cassiem scored from another lineout drive things looked uncomfortable for Wales.
Tipuric eased the nerves, and ensured Wales recorded their most successful autumn in more than a decade in a contest only soured by a first-half knee injury to Dan Lydiate.
Man of the match
Justin Tipuric. Even his trademark blue scrum cap was immaculate. The Ospreys man is a class act.
It is Italy in Rome in the Six Nations for Wales in February. South Africa face the inquest to end them all when they arrive home.
Wales: 15-Leigh Halfpenny, 14-George North, 13-Jonathan Davies, 12-Scott Williams, 11-Liam Williams, 10-Dan Biggar, 9-Gareth Davies; 1-Gethin Jenkins (captain), 2-Ken Owens, 3-Tomas Francis, 4-Luke Charteris, 5-Alun Wyn Jones, 6-Dan Lydiate, 7-Justin Tipuric, 8-Ross Moriarty.
Replacements: 16-Scott Baldwin, 17-Nicky Smith, 18-Samson Lee, 19-Cory Hill, 20-Taulupe Faletau, 21-Lloyd Williams, 22-Sam Davies, 23-Jamie Roberts.
South Africa: 15-Johan Goosen, 14-Ruan Combrinck, 13-Francois Venter, 12-Rohan Janse van Rensburg, 11-Jamba Ulengo, 10-Elton Jantjies, 9-Faf de Klerk; 1-Tendai Mtawarira, 2-Adriaan Strauss (capt), 3-Lourens Adriaanse, 4-Pieter-Steph du Toit, 5-Lood de Jager, 6-Nizaam Carr, 7-Uzair Cassiem, 8-Warren Whiteley.
Replacements: 16-Malcolm Marx, 17-Steven Kitshoff, 18-Trevor Nyakane, 19-Franco Mostert, 20-Jean-Luc du Preez, 21-Piet van Zyl, 22-Pat Lambie, 23-Lionel Mapoe.
Referee: Romain Poite (France)
Touch judges: Greg Garner (England) Tom Foley (England)
TMO: Simon McDowell (Ireland)