© PA Photos
A quiet opening 10 minutes saw each side kick a penalty. Mistakes by the Murrayfield side then gave South Africa a run of penalties, including one that the Springboks kicked into touch for a lineout.
The move resulted in Adriaan Strauss going over to score his first try for South Africa.
A further penalty kicked by Pat Lambie saw the visitors take a 14-3 lead at half-time.
Strauss added his second try shortly after the break to open up a 16-point lead for South Africa.
Scotland came back into the match with just under half an hour to play through a Henry Pyrgos try. A gap in South Africa's line allowed Pyrgos to slip through from a Scottish lineout.
Scotland were the stronger of the two sides for the remainder of the game, but could not get the ball over the try line.
Flip van de Merwe was sin binned with four minutes to go, giving Scotland late hope, but they ran out of time to overturn South Africa's 11-point lead.