France will play England to decide who tops Pool C on Saturday after they finally subdued a battling Tonga.
France put in a characteristically fitful display – racing into a 17-point lead before being reeled in, then rallying before a late Tonga try set up a frantic finale.
However, Damian Penaud reclaimed Camille Lopez’s restart to end the underdogs’ hopes of snatching a win.
Pool C’s winners will face the runners-up in Pool D in the last eight.
Australia look the most likely to finish second in Pool D, while Wales will top that group if they can negotiate matches against Uruguay and Fiji.