Gatland breathes sigh of relief
Converted tries by Scott Williams and Hadleigh Parkes (2) had seen Wales race out to a 21-3 lead, the home side happy to torment the South African backs.
But tries by Warrick Gelant and Handre Pollard pulled the visitors right back into the game and their increased street-savviness almost saw them snatch a victory that had looked far from likely early on in the game.
A third try from Jesse Kriel saw the Springboks briefly take the lead before Leigh Halfpenny's decisive penalty 12 minutes from time.
"It's a bit of relief," said Gatland, whose team went down to Australia (21-29) and New Zealand (18-33) either side of a scrappy 13-6 win over Georgia in their November series.
"We started so well and looked comfortable, but the five minutes either side of half-time weren't the best periods of the game for us,"
Gatland added: "We deserved that and we can be pleased with lots of things given the number of injuries we've had and the players we've blooded, the way we've tried to be positive.
"There are lots of things we can take out of this campaign in terms of developing strength in depth in the squad.
"It was pretty nailbiting, but that's what sport's about, what Test match rugby is about, and I'm pleased we came out on the right side,"
Two-try hero Parkes, like Gatland a New Zealander, qualified for Wales just hours before the match, but the coach had had no hesitation about throwing him into the firing line.
"I said 'just make the most of your opportunity' and he did that," Gatland said of the pre-game advice to his countryman.
"He's carried well and defended well. He's an experienced player, we know where he's come from,"
Even though it was his first cap, Gatland said he had called upon Parkes to take up a leadership role within the team boasting six Scarlets teammates.
"He's had a lot of rugby under his belt," he said. "He's done great, a fantastic pick-up for the first try and obviously a brilliant pass from Taulupe [Faletau] for the second.
"He's carried, a nice couple of kicks through. He's 100 percent he was saying in the changing room, so he's pretty happy with himself,"