Scotland blew a 6-0 half-time lead as Argentina extended their 19-year winning streak at Murrayfield and inflicted Andy Robinson's first defeat in charge.
The home side put themselves on course to complete a clean sweep of autumn international victories for the first time since 2002 thanks to two Phil Godman penalties.
But Argentina turned the game on its head after the break, taking advantage of Nathan Hines’ needless sin-binning with two penalties from Martin Rodriguez.
Rodriguez completed the comeback with a drop goal two minutes from time to hand the Pumas a 9-6 win, their fourth straight victory in Edinburgh.
Robinson’s 100% start as head coach had included beating Fiji and a historic win over Australia, while the Pumas had lost the opening two games of their UK tour against England and Wales.
When Allan Jacobsen lashed out on halfway, Rodriguez had an early chance to put Argentina ahead. The centre, however, made a hash of his penalty.
Juan Martin Fernandez Lobbe was penalised for going over the top in the 14th minute, and Godman kicked the home side ahead from 25 metres.
Ben Cairns was justifying his recall with some elusive running and his latest break earned Scotland a 19th-minute penalty, but Godman was well off target from near the touchline.
A minute later, a superb break by Sean Lamont should have led to a try but, despite getting within five metres, the home side could not breach the Pumas defence and Godman’s crossfield kick drifted into touch.
Godman missed a very kickable 35-metre penalty in the 24th minute, and the game was becoming a gruelling forward battle until a brilliant kick and chase from Rory Lamont four minutes from the interval led to a penalty, which Godman converted from almost 40 metres.
Chris Cusiter was forced to touch down behind his own tryline to prevent the Pumas scoring early in the second half, with Rory Lamont appearing to hurt his left leg badly in a tackle.
While the full-back was receiving treatment, a wound-up Hines was sin-binned for a spear tackle on Gonzalo Tiesi.
Lamont was taken off on a stretcher to be replaced by Chris Paterson before Rodriguez finally took a 40-metre penalty to halve the deficit.
A dominant Argentina eventually made the extra man count with another Rodriguez penalty to level the match.
An infringement at the scrum gave Rodriguez the chance to put Argentina ahead with less than 15 minutes remaining but his 50-metre penalty did not have the legs.
Scotland responded with their best attacking move involving great interplay between Johnnie Beattie, Sean Lamont, Nick de Luca and Cusiter, with the latter thwarted by a desperate tackle.
A raft of substitutions followed, as did more errors from both sides, with the scores still locked going into the closing stages.
But with less than three minutes remaining, Argentina worked themselves into drop-goal range and Rodriguez made no mistake to cap the Pumas' comeback.