Scotland celebrated a Six Nations win in Wales for the first time in 18 years with victory in Llanelli.
The dour match was hampered by the swirling wind as Wales led 7-6 at half-time following a Rhys Carre try.
Replacement Scotland hooker Stuart McInally scored a second-half try and Stuart Hogg added a late penalty to seal victory.
Wales captain Alun Wyn Jones finished on the losing side as he became the world's most capped international player on his 149th Test appearance.
The desperately disappointing contest was far from pretty in challenging conditions but Scotland will not care as they celebrated three successive tournament victories for the first time since 1996.
Scotland have also won four successive Tests for the first time since a five-game winning streak in 2011.
Flanker Jamie Ritchie enhanced his British and Irish Lions chances with a monumental man-of-the-match display as Scotland won the breakdown battle.
Scotland achieved their win despite coach Gregor Townsend losing both fly-halves Finn Russell (groin) and Adam Hastings (shoulder) to injury during the match, with captain Hogg finishing the match in that position.
Woeful Wales had been desperate for a win to arrest a difficult start under head coach Wayne Pivac, but have now lost four matches in the tournament for the first time since 2007 as they went from defending champions to fifth place.
The home side have beaten only Italy under Pivac, who succeeded fellow New Zealander Warren Gatland in the role last November, and have now lost their last five games, with seven defeats in the last eight matches.
Wales made seven changes from last weekend's warm-up defeat in France, with Exeter prop Tomas Francis and Wasps lock Will Rowlands coming into the pack along with debutant Cardiff flanker Shane Lewis-Hughes.
Scarlets' Liam Williams was preferred to George North on the wing, Ospreys centre Owen Watkin started at centre and Scarlets scrum-half Gareth Davies replaced the injured Rhys Webb.
Wales were forced into a late change just an hour before the game with flanker Justin Tipuric ruled out with tonsillitis and replaced by James Davies.
Scotland fly-half Russell made a first appearance of this Six Nations after his exile for breaching team protocols was ended.
The Racing 92 playmaker was one of four changes following the win against Georgia last week alongside Exeter double-winning duo Stuart Hogg and Jonny Gray, while Scarlets back-row Blade Thomson came in on his home ground.
The game took place at Parc y Scarlets in Llanelli as Cardiff's Principality Stadium is being decommissioned as a coronavirus hospital.
There was no crowd to see Jones set a new world record of 149 Test appearances, including nine for the British and Irish Lions, beating the previous best of New Zealand legend Richie McCaw.
The irony for life-long Osprey Jones running out at Parc y Scarlets, the home of his local rivals, to achieve his magical milestone will not have been lost on him.
There was a period of silence to show support for rugby against racism and to mark the passing of former Wales and Lions wing JJ Williams, who died this week aged 72.
Line-out lottery
After a frantic opening which was dominated by the strong swirling wind, Russell opened the scoring at his second attempt at the posts after Ryan Elias was caught offside.
The Welsh indiscipline caused them problems, with referee Andrew Brace continually penalising the hosts at the breakdown.
Scotland blew a try-scoring chance with centre Chris Harris spilling a try-scoring chance following a Hogg break.
It was a line-out lottery for both sides in the wind, but Scotland's dominance elsewhere on the pitch was demonstrated by their ball-carrying statistics and breakdown superiority.
Wales demonstrated their clinical nature by scoring a try in almost their first visit to the 22, Elias latching onto a loose line-out throw after Scotland surprisingly decided to throw long.
Prop Carre eventually burrowed over for his first international try which Dan Biggar converted.
Scotland suffered a blow when Russell was forced off the field injured and replaced by Hastings, who slotted over a penalty to expose further Wales indiscipline to reduce the half-time deficit to one point.
Wales fly-half Biggar was forced off early in the second half and replaced by Rhys Patchell during a good spell for the home side as they continually turned Scotland over.
Hogg and Hastings looked dangerous in the visiting backline though as they rose above the mediocrity and Scotland restored their lead through a driving line-out from replacement hooker McInally, although Hastings missed the conversion.
Leigh Halfpenny reduced the lead to one point with a penalty, before Hastings became the second Scotland fly-half to leave the field.
This caused a reshuffle in the backline with scrum-half Scott Steele coming onto the wing, Blair Kinghorn slotting in at full-back and Hogg moving up to 10.
Inspired by outstanding flankers Ritchie and Hamish Watson, the visitors ignored their backline disruptions and Hogg's late penalty sealed the win.
So it was celebrations for Scotland as they claimed the Doddie Weir Cup but a Six Nations title defence for Wales to forget.
Line-ups
Wales: 15-Leigh Halfpenny; 14-Liam Williams, 13-Jonathan Davies, 12-Owen Watkin, 11-Josh Adams; 10-Dan Biggar, 9-Gareth Davies; 1-Rhys Carre, 2-Ryan Elias, 3-Tomas Francis, 4-Will Rowlands, 5-Alun Wyn Jones (c), 6-Shane Lewis-Hughes, 7-James Davies, 8-Taulupe Faletau
Replacements: 16-Sam Parry, 17-Wyn Jones, 18-Dillon Lewis, 19-Cory Hill, 20-Aaron WSainwright, 21-Lloyd Williams, 22-Rhys Patchell, 23-Nick Tompkins
Scotland: 15-Stuart Hogg (c); 14-Darcy Graham, 13-Chris Harris, 12-James Lang, 11-Blair Kinghorn; 10-Finn Russell, 9-Ali Price; 1-Rory Sutherland, 2-Fraser Brown, 3-Zander Fagerson, 4-Scott Cummings, 5-Jonny Gray, 6-Jamie Ritchie, 7-Hamish Watson, 8-Blade Thomson
Replacements: 16-Stuart McInally, 17-Oli Kebble, 18-Simon Berghan, 19-Ben Toolis, 20-Cornell du Preez, 21-Scott Steele, 22-Adam Hastings, 23-Duhan van der Merwe
Match officials
Referee: Andrew Brace (Ireland)
Touch judges: Mathieu Raynal (France)& Christophe Ridley (England)
TMO: Tom Foley (England)