South Africa 19-12 WalesSouth Africa and Wales gave the crowd a taste of what they can expect in the knock-out stages with a bruising final match of the pool section.
Both teams had already qualified for the last eight, but in the knowledge that the loser would have to play New Zealand, victory was a must.
And at half-time, holding a 12-7 lead, it looked as if Wales could pull off a shock following tries from Jason Forster and Gareth Thomas.
But after the interval the Springboks stepped up a gear to book a meeting against Canada.
First-half try-scorer Jean de Villiers showed his pace in releasing Fabian Juries, who converted for a two-point lead, before Conrad Jantjes scored late on with a chip and charge to give South Africa a cushion in victory.
"We had one or two chances that we let slip," Welsh captain Jason Forster admitted.
"They didn't and they go through tothe easier draw on paper and we have to play the might of the All Blacks."