The world champions live another day to defend the William Webb Ellis trophy while Samoa exit the tournament 16 years after their last quarterfinal appearance.
Wales, who anxiously waited the result of the match, are virtually guaranteed of a berth in the last eight if they can take at least a point out of its match with Fiji on Sunday.
The Samoans had kept the opposition waiting before their Siva Tau and instead of the war challenge boosting their play work it seemingly back fired on the men in blue after eight minutes.
A strong run by second-five Francois Steyn set up the Springboks in the Samoa 22, quickly switching the attack to the left they found a three-man overlap for Bryan Habana to score in the corner.
Morne Steyn stepped up to convert the try and Samoa were down 7-0 in as many minutes.
The Steyns' are deadly in front of goal with the boot, and their goalkicking clinic in the opening half was a spectacle in its own with Francois' 60m effort hitting the cross-bar and a 55m kick going over.
Morne struck a penalty in the 32nd minute to go up 13-0 and with the Springbok pack throwing their weight around the field it was one-way traffic in the firsthalf with Samoa on the backfoot.
The South Sea Islanders had their chances to post points but poor handling and a staunch South African defence denied the Manu who were struggling to win their own ball at lineout and scrum-time.
With the wind at their backs in the secondhalf and trailing by two tries, Samoa overturned their physical battering and muscled up in the tight encounters to rattle South Africa.
A breakthrough eventually came for Samoa who crossed the chalk ten minutes in to the second forty to shake the match into life.
Eliota Fuimaono Sapolu's classy no look-pass inside found Tusi Pisi on the wrap-around before he was dragged down, two phases later number-eight George Stowers hit a short-pass before slamming the ball over the tryline.
Pisi missed the conversion but Samoa were back in the match.
Samoa went back into enemy territory on numerous occasions in search for a second five-pointer with winger David Lemi and Sapolu making plenty of running metres.
Sapolu went closest in the 73rd minute to getting over the tryline but his slicing run was met by a charging Schalk Burger who stopped him inches short.
With the match hanging in the balance both teams were reduced to 14 men with ten minutes remaining after Paul Williams and John Smit were shown the red and yellow card respectively.
It was tense ending to a bruising clash as the Samoans emptied the tank, throwing the ball around to try and sneak a late win.
However the Springboks defended their line soundly with the flankers Heinrich Brussow and Burger particularly impressive in their defensive play.
South Africa 13 (Bryan Habana try; Morne Steyn conversion, penalty; Frans Steyn penalty), Samoa 5 (George Stowers try) HT: 13-0.
- HERALD ONLINE