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.
Leigh Halfpenny scored a 68th-minute penalty to hold off a late fightback from South Africa
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.
Hadleigh Parkes scored ran in two tries just hours after qualifying for his Welsh residency
Scott Williams' touchdown helped Wales take complete control of the Autumn International
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