Tonga has beaten Scotland for the first time, coming from 15-10 down after an hour to triumph 21-15 at Pittodrie Stadium.
The result was all the more remarkable as three Tongans were sin-binned and the team played for more than 20 minutes down a man and briefly at the end with 13.
But Tonga scored the only two tries of the game, both in the second half, against five penalties to Scotland fist five Greig Laidlaw from seven attempts.
"That was a totally unacceptable performance we've witnessed today," Scotland coach Andy Robinson said.
"From my side I'm very angry. There will be consequences because of this performance. I won't go through yet what those will be. It reflects on me."
Scotland, the Six Nations wooden-spoon holders who revived their fortunes with June tour wins in Australia, Fiji and Samoa, finished the year with successive defeats to New Zealand, South Africa and Tonga and without a win at home. Meanwhile, Tonga celebrated its biggest victory since toppling France in last year's World Cup.
The Scots had more than enough territory and possession to add to their two previous wins over Tonga in 1995 and 2001. They had 17 lineouts and stole three of Tonga's throw-ins, and enjoyed a penalty count of 23 to 12. But Scotland fumbled passes everywhere and could never quite escape from the Tongans' clutches.
The home side paid for its inability to score more against a side with a never-say-die mentality. The Tongans, who were edged by Italy and came from behind to beat the United States a week ago, used their tackle-busting ability to ultimately create tries for flanker Lua Lokotui and, decisively, right winger Fetu'u Vainikolo. Flyhalf Fangatapu 'Apikotoa added 11 points from his boot.
French referee Mathieu Raynal made his impatience known with Tonga's frequent fouls by sin-binning Lokotui in the 33rd minute for obstruction at a lineout. Laidlaw kicked Scotland to a 6-3 lead at halftime.
When Lokotui returned in the second half, he was on the end of a chain to burrow over in the 53rd. 'Apikotoa's conversion put Tonga 10-9 ahead.
Laidlaw kicked two more penalties to give Scotland a five-point lead entering the last quarter. But within four minutes 'Apikotoa had kicked a penalty and Vainikolo had blown down the left touchline to score his fourth try for Tonga and an 18-15 lead.
Moments later, Tonga captain Nili Latu was yellow-carded for jumping onto a maul. Replacement first five Tom Heathcote's penalty chance fell short but 'Apikotoa kicked his third penalty to make it 21-15 with eight minutes to go.
Substitute Steve Mafi was sin-binned to leave Tonga with 13, but Latu returned to help stall an attacking scrum by Scotland. The match finished with Heathcote dropping a pass from Rory Lawson.
Tonga 21 (Lua Lokotui, Fetu'u Vainikolo tries; Fangatapu 'Apikotoa conversion, 3 penalties), Scotland 15 (Greig Laidlaw 5 penalties). HT: 3-6
What would you rate as a fair price for a mediocre seat at the Rugby World Cup final next year?