Scotland ended their Wales woes to keep their Six Nations hopes well and truly alive in a 29-13 victory at Murrayfield.
Wales had not lost to their Celtic rivals since 2007 and they led 13-9 at the end of a first half they largely controlled with Liam Williams touching down.
The momentum swung in Scotland's favour shortly after the restart, though, with Tommy Seymour's converted try putting the home side in front.
A lack of clinical edge and stoic Scottish defence meant Wales remained in arrears and Tim Visser - in for the injured Sean Maitland - added a second score for the hosts with 14 minutes remaining.
Scotland, who saw Man of the Match Finn Russell kick 19 points in the absence of injured captain Greig Laidlaw, now have two wins from three matches and face a huge match against defending champions England next time out.
Rob Howley's Wales failed to rebound from a last-gasp loss to England and, with just one win from three matches, their chances of winning the title are surely over.
Russell and Leigh Halfpenny traded penalties in a scrappy open, but Wales soon began to dominate in the breakdowns and had the first try in the 22nd minute.
The brilliant Rhys Webb tapped a quick penalty and the ball was quickly worked left for Halfpenny to play in Liam Williams in the corner.
Webb was a constant irritant for Scotland and almost played in Liam Williams again before being pinged for pulling Seymour's shoulder.
Russell and Halfpenny again exchanged kicks, before Scotland finally exerted some pressure in the final moments of the half, but their peppering of the line only yielded another three points for Russell.
Scotland's improvement continued early in the second half and they went in front in the 44th minute.
Stuart Hogg cleverly delayed his pass to Visser, who in turn popped to Seymour and he squeezed in on the right corner despite a great effort from Scott Williams.
A swift Jonathan Davies break almost had the visitors in for a second score, but Scotland stretched the lead through Russell's boot after Wales for pulled up at the ruck.
Wales enjoyed a large period of possession and territory without adding to the scoreboard.
And Scotland landed the decisive blow. Hogg was again instrumental with quick hands to spread the ball wide to Visser, who crept round the back to score.
The flawless Russell added the extras and he kicked another penalty that left Wales with no chance of a comeback.