Hull star Stanley Gene inspired Papua New Guinea to a World Cup quarter-final clash with Wales with a hard fought win over Tonga at the St Esteve ground in Perpignan.
The unbeaten Kumuls top Group Three at the end of the pool stages. France, who finished second, will face New Zealand.
Tonga were first across the try line after 10 minutes when Moala went in from a Phil Howlett pass, the winger converting his own try.
The Kumuls knew that a win or a draw would be good enough to send them into the last eight, and they stormed back in style when half-back Adrian Lam and Gene combined superbly to put Michael Mondo in after 19 minutes, with Wiltshere converting.
Then Gene made the most of a handling error to pounce and stretch his side's lead to 12-6 four minutes later.
A David Buko try, and another Wiltshere conversion, made it 18-6. Willie Mason powered his way over under the posts a minute before half time to give Tonga hope and Moala added the extras to leave PNG sweating on a 18-12 lead.
Wiltshere eased the Kumuls' nerves with a penalty two minutes into the second period, and big prop Raymond Karl crashed over to seemingly put PNG well in control.
But Tonga came storming back with a second try from Moala and a stunning effort from Bradford Bulls star Tevita Vaikona brought his side to within two points at 24-22.
But the game swung firmly in PNG's favour when Gene swooped for his second try of the night as he got on the end of an inch perfect Lam kick, Wiltshere converting.