A committed Wales outfit pushed Tonga to the limit before the hot favourites prevailed 32-6 at Totally Wicked Stadium in St Helens.
The win leaves Tonga on track for a blockbuster quarter-final showdown against Samoa but they will need to improve their discipline and get some combinations right if they are to challenge for the title.
An early mistake by halfback Josh Ralph at dummy half put Wales under huge pressure but they held firm for a number of sets after Tui Lolohea and Talatau Amone had forced line dropouts with well placed grubbers.
Tongan winger Sione Katoa returned the favour in the 10th minute when he spilled the ball five metres out from his own line and Wales got across the stripe through Dalton Grant but scramble defence by Amone and Tesi Niu denied him.
Come the 16th minute and the Welsh had their try through winger Kyle Evans, who forced an error from Siosifa Talakai with a strong tackle and then took a pass from Ralph to race away and score. Matty Fozard converted for 6-0.
Tonga needed just five minutes to hit back when Daniel Tupou took a pass from Niu to cross in the left hand corner for the first of his three tries.
A dropped ball by Connor Davies late in the first half proved costly for Wales, with David Fifita powering across from close range to give Tonga the lead for the first time.
Keaon Koloamatangi’s second try of the tournament on the stroke of half-time extended Tonga’s advantage to 16-6 at the break as Kristian Woolf’s side started to hit their straps.
Fullback Tesi Niu was next to score for Tonga, evading several defenders on a weaving run to the line in the 47th minute to make it 22-6.
Some desperate online defence by Wales lock Joe Burke denied Lolohea a try in the 51st minute but weight of possession eventually told when Tupou crossed for his second four-pointer on the hour mark and the floodgates threatened to open.
Manly flyer Tolutau Koula produced a spectacular play in the 66th minute when he launched himself across the sideline and flicked the ball back inside to set up a try but the video referee correctly ruled the ball had grazed the line before he scooped it back.
Some slick passing on the left edge by Tonga finished with Tupou completing his triple after taking the final pass from Talakai, who converted the try for a 32-6 lead.
Tupou got across the line again with three minutes to play but an obstruction by Talakai in the lead-up meant the veteran flyer would have to settle for a hat-trick.
Source: NRL.com