Two tries in the last 12 minutes helped Canada record the Rugby World Cup's first upset by beating Tonga.
Canada led 10-7 at half-time through Jebb Sinclair's converted try with Siale Piutau replying before the break.
Piutau added his second try on the resumption, Kurt Morath converting and adding two penalties to make it 20-13.
Canada came roaring back and tries from Aaron Carpenter, after 68 minutes, and Phil Mackenzie seven minutes from time earned them a famous victory in Pool A.
James Pritchard, who plays for Bedford Blues in the English Championship, converted the latter as he kicked 10 points in all, including penalties in either half to help give Canada their first points of the World Cup.
Tonga dominated the first half but somehow found themselves 10 points behind. They started the game with some impressive rugby that lasted 15 phases, and that set the tone for the rest of a gripping opening period.
However, for all their dominance, Tonga were let down by poor discipline and some erratic handling and it was Canada who opened the scoring albeit against the run of play.
London Irish-bound lock Sinclair scored it, bundling over in the right corner after Glasgow centre's DTH Van Der Merwe piercing midfield break.
Pritchard added the extras but Tonga then missed two penalty opportunities with Morath experiencing an indifferent half with the boot.
More Tonga indiscipline resulted in Pritchard extending Canada's lead as they grew in confidence as the half wore on.
But on the stroke of half time Tonga were handed a lifeline with Piutau crossing after intense pressure that saw his side camped on Canada's line for several minutes. Morath added the conversion to make it 10-7.
Tonga's full-back levelled with the boot just a couple of minutes after the restart with Canada penalised for not releasing the ball at a ruck but Pritchard restored their lead with his second penalty soon after.
Piutau then grabbed his second converted try of the game to give Tonga the lead for the first time, with the centre going in under the posts after a clever reverse pass found his angled run.
Scrum infringement led to Morath sending over his second penalty to stretch Tonga's lead to seven points.
But Canada came roaring back with 12 minutes left, levelling through Plymouth Albion's Carpenter who bundled over in the corner after a Tonga handling error on halfway allowed them to break.
Pritchard missed the kick, and with it the chance to level, but with time running out Esher wing Mackenzie jinked his way through the desperate Tonga defence to score his side's third try of the game.
Pritchard converted it to give Canada a 25-20 lead.
Tonga had late opportunities but wasted two penalties and Canada managed to hold on.
"That was awesome. I'm so proud of the boys, the way they played," said Canada captain Pat Riordan. "Just awesome."
"It just shows what the Canadian boys can do."
It was a second loss in five days for Tonga after a 41-10 defeat to No. 1-ranked New Zealand in the tournament's opening match last Friday night.
"We didn't play the way we wanted to play," skipper Finau Maka said. "Credit to Canada, they came out and defended well ... controlled the ball well. They deserved to win."
Tonga: Morath, Vainikolo, Piutau, Fatafehi, Helu, Moa, Palu, Taumalolo, Taukafa, Pulu, Timani, Lokotui, Maka, Vaiomounga, Vahafolau. Replacements: Iongi for Palu (70), Tonga'uiha for Taumalolo (75), Ma'asi for Taukafa (64), Aulika for Pulu (52), Kalamafoni for Timani (54), Ma'afu for Vahafolau (49).
Not Used: Taufa.
Canada: Pritchard, Hearn, van der Merwe, Smith, P. Mackenzie, Monro, Fairhurst, Buydens, Riordan, Marshall, Sinclair, Cudmore, Kleeberger, O'Toole, Carpenter. Replacements: Trainor for Smith (64), Hamilton for Riordan (69), Franklin for Marshall (75), Dala for Sinclair (75), Hotson for O'Toole (32).
Not Used: White, Paris.
Ref: Jonathan Kaplan (South Africa).