What a scare for the Springboks, and perhaps some lessons learned by coach Jake White and his team:
Lesson 1: Don't put out a second string side against probably the second strongest team in the group, especially one on the up like Tonga, having just beaten its Pacific neighbours Samoa for the first time in 7 years.
Lesson 2: Don't let Andre Pretorius anywhere near the kicking duties. The stand-off missed four of five easy kicks today, probably the most abject performance with the boot of the tournament thus far.
Lesson 3: Once you've stretched into a comfortable lead after bringing on your better players from the bench, don't, whatever you do, get a pair of players sin-binned and allow the opponents back into the game, nearly snatching defeat from the jaws of victory in the final moments.
That said, full credit must go to the Tongans. They never took a backwards step throughout the match, kept their discipline, and only ever looked in danger on the rare occasions that the Springboks cut loose on the wings.
If the England squad were watching that ahead of their own match against Samoa, they will know that their final game of the group stages against the Sea Eagles will be an incredibly tough test, with the winners likely to meet Australia in the quarter-finals.