Dan Parks kicked Scotland to a 21-17 victory in the second EMC Autumn Test at Murrayfield, ending South Africa's hopes of a Grand Slam.
Scotland head coach Andy Robinson was seeking a response from the 49-3 loss to New Zealand last weekend and he got it as the hosts edged a scrappy encounter laden with penalties and decided by the boot of Parks.
Scotland were without a win over South Africa since the 2002 Murrayfield meeting but eight years on Parks, so often the hero in recent times, demonstrated his unerring accuracy, kicking six penalties and a drop-goal to punish the Springboks' indiscipline.
Morne Steyn kicked four penalties and Willem Alberts crashed over for a try for the visitors.
It was Scotland's fourth win in five Tests and just a second victory over South Africa in 13 post-Apartheid meetings.
Scotland captain Rory Lawson praised his team after they adapted better to the conditions which were made difficult by rain.
Lawson told BBC1: "Those conditions were really brutal out there.
"It was all about field position and we got the upper hand on that. It was all about being together and working hard for each other."
Man of the match John Barclay added: "I think after last week we were so bitterly disappointed.
"This is a step in the right direction. The belief is so strong, (we are) a very tight squad. We knew if we could play to our abilities we could win these games."