Defending champions South Africa scraped past Samoa 13-5 in a bruising and highly-charged encounter on Friday to reach the Rugby World Cup quarterfinals.
The Springboks faced by far the toughest test of their seven meetings with Samoa, but a converted try from winger Bryan Habana and a penalty apiece from Morne and Frans Steyn in the first half proved enough for victory in their Pool D match at North Harbour Stadium.
The Boks led 13-nil at halftime and there was very little between the two sides for most of the match. However, the Samoans coughed up too much ball in the tackled ball area which killed off many of their attacking chances.
Samoa were also never able to get on the right side of Welsh referee Nigel Owens, who managed to find numerous errors which resulted in the Springboks gaining territory and possession.
South Africa had the advantage in the set pieces and both Steyns kicked the side into scoring positions and slotted goals on offer.
Samoa, who scored only the second try the Springboks have conceded at the World Cup through George Stowers, exit the tournament with pride intact but will rue the dismissal of fullback Paul Williams in the 69th minute for striking Heinrich Brssow in the face.
South Africa, seeking to become the first country to retain the Webb Ellis Cup, finish unbeaten at the top of Pool D.
They move on to a quarterfinal in Wellington next week, most likely against Australia.
Samoa are out of the tournament - unless Fiji can upset Wales at Waikato Stadium in Hamilton on Sunday.
South Africa: Try: Bryan Habana; Penalties: Frans Steyn, Morne Steyn; Conversion: Morne Steyn.
Samoa: Try: George Stowers.
Referee: Nigel Owens (Wales).