Scotland finally ended their long wait for an away win against Wales with a 14-10 success in their Six Nations finale that spoilt home captain Alun Wyn Jones' record-breaking appearance.
This was Scotland's first win on Welsh soil since 2002 and also meant they ended the coronavirus-delayed tournament having won three successive Championship matches for the first time in 24 years.
By contrast, the result saw reigning Six Nations champions Wales suffer a fifth successive loss in all Tests under coach Wayne Pivac.
Scotland replacement hooker Stuart McInally's try just after the hour mark proved to be a crucial score.
Although Leigh Halfpenny cut the visitors' lead to 11-10, Scotland captain Stuart Hogg put the result beyond doubt when he landed a penalty with the last kick of the game after impressive flanker Jamie Ritchie won a turnover.
It was not the way Wales captain Jones would have wanted to mark his 149th Test as he took sole possession of an international appearance record he had shared with 148-time capped Richie McCaw, New Zealand's now-retired World Cup-winning captain.
A match delayed by several months was played behind closed doors at Llanelli's Parc Y Scarlets after Wales' Cardiff headquarters was commissioned as a field hospital by the Welsh government in response to the Covid-19 pandemic.
There was a minute's silence before kick-off to mark support for Rugby against Racism and to remember former Llanelli, Wales, and British and Irish Lions wing JJ Williams, who died aged 72 on Thursday.
Wales, fresh from a 38-12 defeat by France, were forced into a late change shortly before kick-off when flanker Justin Tipuric had to withdraw with tonsilitis.
Scotland fly-half Finn Russell was handed a first Test start since last year's World Cup after patching up his relationship with Dark Blues coach Gregor Townsend.
Meanwhile Hogg and lock Jonny Gray returned after helping Exeter win an English Premiership and European Champions Cup double with Exeter.
Russell missed with an early penalty before landing a 35-metre chance.
But the Scots paid for failing to make more of their early dominance when Wales scored the opening try of the match nine minutes before half-time with their first entry into the visitors' 22.
Scotland hooker Fraser Brown was off-target with his throw to the back of a line-out and the Wales forwards pounced, with prop Rhys Carre surging over and fly-half Dan Biggar converting to put the hosts 7-3 up.
Falling behind was made worse for Scotland when Russell limped off what appeared to be a groin injury, with Hastings coming on as a replacement.
Hastings, the son of Scotland great Gavin, cut Wales' lead to a point when he landed a 22-metre penalty with the last kick of the first half.
Wales lost their No 10 as well when Dan Biggar went off injured early in a scrappy second half.
The match came to life just after the hour with a Scotland try.
From a scrum penalty, Scotland kicked for the corner, with the ensuing line-out seeing McInally driven over.