KEY POINTS:
South Africa 30
Tonga 25
One bounce was all it took. Tales of the cruel or wondrous bounce of the rugby ball have littered the game's history, call it the "if only" factor.
Had Pierre Hola's deep kick towards the right corner in the last moments bounced up or left, Tonga could have produced the biggest upset, bar none, in World Cup history.
Instead, with replacement Aisea Havili haring down on the ball, it went right, into touch and South Africa were spared a massive humiliation.
But perhaps humiliation does not do justice to a remarkable day for Tonga.
This was the best match of the Cup so far, a contest made memorable by Tonga's refusal to lie down, and their absolute desire to prove their credentials as the most improved team at the tournament.
Having beaten the United States, then tipped over the more fancied Samoans, they went toe to toe with one of the Cup favourites and came desperately close to stunning the rugby world.
If they had succeeded there would have been no question it was achieved on merit, not through good fortune.
Their game was built on wholehearted defence, adventurous running, a scrum which went well, apart from the odd second-half wobble, and a tidy lineout which won most of its own ball largely through the efforts of Paino Hehea and Viliami Vaki.
The anticipated sparks between two ferocious packs didn't eventuate, save the occasional hard look. This was largely because Tonga kept their powder dry when many feared they might not, and kept their mind on the game, which they were all the better for.
South Africa had put out a B team and they sensed trouble early in the second half, when prop Kisi Pulu, with inspirational No 8 Finau Maka driving in behind, scored. After first five-eighth Hola converted Tonga led 10-7.
Coach Jake White responded like a commander recognising he needed his crack troops pronto, and on came Victor Matfield, John Smit, BJ Botha, Bryan Habana and Francois Steyn.
The game was decided by a three-try flurry in six minutes, with Juan Smith, captain Bob Skinstad and Ruan Pienaar - his second of the day - getting across with tries built on sweeping movement and slick support work.
Tonga's response? Upwards and onwards, with centre Sukanaivalu Hufanga leaping high to clutch Hola's perfectly delivered crosskick and get the ball down millimetres inside the touch-in-goal line.
Two minutes later, flanker Vaki finished off an 80m surge when a Springbok attack broke down, and the gap was five points with seven minutes to go.
Cue eruptions in the rugby bars of France and at least one in Edinburgh.
A late Percy Montgomery penalty - in his Springbok record 90th test appearance - made the win safe, but Hola's final penalty ensured a bonus point.
Flanker Nili Latu and Maka were outstanding leaders, and Hola organised things impressively. Tonga's skills and spirit made for an exhilarating match in which the Springboks received a timely advisory about underestimating opponents.
The upshot of that, and England's win over disappointing Samoa is simple: Tonga v England at Parc des Princes in Paris next Saturday morning, with the winner into the quarter-finals.
"Our hopes are up," Latu said.
White was unrepentant at his decision to drop a stack of his finest.
"We got five points, it was the right decision," White said. "It's called a test match and we got tested, all credit to Tonga."
But Skinstad reckoned "we were lucky to get five points today. We were lucky not to suffer an embarrassing loss or draw."
Dead right. A game to savour for those who love the struggles of rugby's battlers.
The day's only sour note: the sneering group of All Black supporters, in their black kit, who delighted in mocking the Tongans for their technical shortcomings in an Edinburgh bar. Makes you proud.