All square at 18 points a piece heading into the final ten minutes, neither team could find a way over the tryline until absolute chaos saw Keaon Koloamatangi crash over for the match-winning try.
He would be trapped ten metres out from his own line, but managed to throw a miraculous offload. Tonga would then keep the ball alive with some scrambling play, with the ball bouncing on the ground before Koloamatangi managed to crash over for the match-winning try off a Siosiua Taukeiaho grubber.
Tonga had earlier taken an 18 points to 6 lead into the halftime break after a start where they struggled to show much in attack, clunkiness stopping Mate Ma'a from enjoying their clear advantage in possession and territory.
The Kumuls scored two second half tries to bring the game back to level, the first to Lachlan Lam off an excellent run from hooker Edwin Ipape, before Dan Russell scored off a scrum from ten metres pout which followed a dramatic error on his own line from star Tongan fullback Tolutau Koula.
Koula had otherwise a fantastic game and was one of the contenders to be man of the match, which ultimately went to Ipape.
A difficult moment for Papua New Guinea saw Dan Russell stand on the sideline as he attempted to score what would have been his first try, while the Kumuls were also hit by a moment of bad luck as the video referee determined a seeming try had seen the ball actually touch the sideline.
The Kumuls will now have must-win games against the Cook Islands and Wales to qualify for the quarter-finals, while Tonga are in pole position to finish in first out of Group D to likely avoid England until the semi-finals, but set up a quarter-final with Samoa.
Tonga 24 (Tries: Will Penisini, Moeaki Fotuaika, Isaiya Katoa, Keaon Koloamatangi; Conversions: Isaiya Katoa 4/4) defeat Papua New Guinea 18 (Tries: Rhyse Martin, Edwin Ipape, Dan Russell; Conversions: Rhyse Martin 3/3)