The victory was Scotland’s first in Wales since 2002, and means they have won three straight Championship games for the first time since 1996.
Wales were condemned to a fifth straight defeat, meaning Alun Wyn Jones had little to celebrate as he became Test rugby’s most-capped player, with 149.
They will finish fifth in this season’s table, having only beaten Italy.
A lot of wind and a bit of rain in Llanelli made every player’s life difficult, not least the hookers – who consistently failed to throw straight – and those kicking, whether from hand or tee.
The weather did not, it is fair to say, do much for the spectacle. Scotland ran the show in the first half hour, but had only a 3-0 lead to show for it.
Finn Russell saw one penalty winded, but was successful with his second. It was Wales, though, who scored the first try.
Fittingly, it came from a lineout error from Scotland, with Fraser Brown overthrowing after a neat gather and kick from Taulupe Faletau put Scotland under pressure metres from their own line.
Wales gleefully nabbed the ball, kept it tight and Rhys Carre eventually went over under the posts for his first international try. Dan Biggar added the extras.
Scotland’s pain was deepened by the loss of Russell, who appeared to injure his groin in the defensive effort.
His replacement, Adam Hastings, nudged over a second penalty on the stroke of half-time to cut Wales’ lead to just one point.
Soon after the resumption, Wales also lost their fly-half, Biggar, to injury while Russell’s replacement, Adam Hastings, suffered a stinging shoulder issue, but was able to continue for 20 minutes.
When he eventually went off, a major reshuffle was required in the Scotland backline, with captain Stuart Hogg playing fly-half and debutant Scott Steele – a scrum-half – out wide.
By then, Scotland were in the lead. They rung the changes in the third corner and one of the replacements, hooker Stuart McInally scored – and indeed made – their first try on the hour.
Scotland won a scrum penalty 40 metres out and, rather than take a risk kick at goal in the wind, went for the corner.
McInally found his man and immediately gathered the ball at the back of a rolling maul which rumbled 15 metres to the tryline. Hastings was unable to make the conversion.
From there, Scotland kept things tight, defending gallantly – with man of the match Jamie Ritchie to the fore – and going through the phases when they did have the ball
.After a particularly patient bit of defence, Ritchie won a penalty in front of the posts which Hogg, Scotland’s third fly-half and third kicker, put through to secure victory.
Coverage in association with QBE Insurance. QBE Insurance helps businesses build resilience through risk management and insurance. For more information go to QBEEUROPE.COM