Greig Laidlaw's conversion ensured Scotland completed a clean sweep on their southern hemisphere tour following wins over Australia and Fiji.
Laidlaw had converted Joe Ansbro's first-half try, and also scored a penalty.
Fly-half Tusi Pisi scored all Samoa's points, kicking a drop-goal, two penalties and converting his own try.
For the second successive meeting between our two countries, Samoa have lost out at the death – in Aberdeen two years ago Ruaridh Jackson’s late penalty proved their downfall and here, an injury time try, fashioned by Mike Blair and finished so emphatically by debutant Robert Harley, the fifth new cap of the tour, ensured a repeat.
Scotland did get out of jail here but after being on the wrong end of some close calls over the past year – think Argentina in Wellington, England in Auckland and, yes, France at Murrayfield – and it would take a hard man to say we didn’t deserve a turn of fortune. Head coach Andy Robinson has thus piloted the first three Test success in the Southern Hemisphere and that’s some achievement from a side that is starting to muster self-belief
Scotland: S Hogg (Glasgow); S Lamont (Glasgow), N De Luca, M Scott, T Visser (all Edinburgh); G Laidlaw (Edinburgh), C Cusiter (Glasgow); R Grant (Glasgow), R Ford (captain) (Edinburgh), E Murray (Newcastle), A Kellock (Glasgow), R Gray (Sale), A Strokosch (Perpignan), R Rennie (Edinburgh), R Vernon (Sale).
Replacements: S Lawson (London Irish), G Cross (Edinburgh), T Ryder, R Harley (both Glasgow), M Blair (Brive), D Weir (Glasgow), M Evans (Castres).