Two tries by New Zealand-born Hadleigh Parkes helps Wales to narrow win over the Springboks
Wales went close to losing a game they should have won comfortably before edging home 24-22 against South Africa in Cardiff.
Full-back Leigh Halfpenny's 68th-minute penalty saved the day after the Springboks fought back from 18 points adrift just before half-time to lead in the final quarter.
Two tries by New Zealand-born centre debutant Hadleigh Parkes and a Scott Williams touchdown, plus three Halfpenny conversions, left Wales in total control as the interval approached.
But the Springboks produced an unexpected recovery act, hitting back through tries from wing Warrick Gelant, fly-half Handre Pollard and centre Jesse Kriel, while Pollard added a penalty and two conversions.
It left Wales to reflect on an autumn series that realised losses to Australia and New Zealand, plus an ugly 13-6 victory against unfancied Georgia and a win against South Africa that raised more questions than it delivered answers.
Even though Wales' list of absentees ran into double figures, South Africa performed only in patches, were there for the taking and looked a pale imitation of previous Springbok sides to visit the Principality Stadium.
Parkes, who only competed a three-year Wales residency qualification period hours before kick-off, was the shining light as he became the the first Wales player since wing George North seven years ago - also against South Africa - to score twice on debut.
Wales settled impressively and they took a fifth-minute lead when fly-half Dan Biggar's superbly-placed kick was caught at full speed by wing Hallam Amos, who cut inside before a delivering a scoring pass to Williams.
Halfpenny converted, but the home side were not finished, and Biggar struck again with another teasing kick over the top of South Africa's defence that this time Parkes collected for a debut Test try after just eight minutes, before Halfpenny's conversion made it 14-0.
Wales were a step ahead in thought and deed, and scrum-half Aled Davies led a break-out that had South Africa defenders retreating, yet the Springboks were starting to exert scrummaging authority, targeting home prop Scott Andrews and gaining penalties as a result.
Pollard opened South Africa's account with a penalty nine minutes before half-time, before South Africa proved architects of their own downfall when full-back Andries Coetzee saw an attempted clearance kick charged down by Biggar before number eight Taulupe Faletau gathered and sent Parkes over unopposed for another touchdown.
Halfpenny's conversion took Wales 18 points clear, only for South Africa to keep their slender hopes alive when wing Dillyn Leyds ran from inside his own 22, and a flowing move ended with Kriel kicking into space and Gelant marking his first Test start by winning a race to score.
Pollard added the extras to cut Wales' advantage, yet South Africa still had it all to do, trailing 21-10 at the break.
And the Springboks suffered an immediate setback when injured skipper Eben Etzebeth failed to appear for the second period, increasing an already acute degree of difficulty against opponents eager and willing to run possession.
South Africa, though, suddenly looked up to the task, and a 46th-minute Pollard try gave Wales cause for concern as a healthy advantage continued to be chipped away at, while a double change saw head coach Warren Gatland sent on prop Wyn Jones for Rob Evans and replace Biggar with Rhys Patchell.
But the Springboks were on a roll, and they went ahead for the first time nine minutes later as Kriel rounded off a crisp move by brushing aside Halfpenny's challenge to claim a try that Pollard converted.
Halfpenny then kicked a penalty 12 minutes from time to put Wales back in front, but it was far from the convincing home win that looked likely at one stage.