South Africa secured a convincing 49-18 win while Tonga scored three tries, their best performance in the competition so far.
Tonga faced South Africa in Marseille in their third pool B game.
They were out of quarterfinals contention after suffering two heavy defeats to Ireland and Scotland.
The Springboks had made 12 changes to their line-up facing Tonga in Marseille in their third pool B game.
Handré Pollard played his first match for South Africa since August 2022, having missed their last 16 tests.
Second-rower Eben Etzebeth, captain Siya Kolisi and number eight Jasper Wiese were the only players to retain their spots in the pack, while the whole backline has changed.
Tonga's Vaea Fifita will miss the rest of the World Cup matches after he was handed a four-game suspension by an independent Disciplinary Committee.
Look back at all the action on RNZ Pacific's blog: