Wales were made to work hard as they maintained their excellent Six Nations record against Scotland with a 27-23 victory at the Principality Stadium.
Vern Cotter's men improved on their performance in defeat against England in round one, but nevertheless remain without a win in Cardiff since 2002 and have now lost their last nine matches in this competition.
Scotland overcame a poor start to forge ahead on three occasions, albeit only by a slender margin, before Wales came on strong in the final quarter and reclaimed the lead through a Jamie Roberts try.
George North then capitalised on some tired defending to surge over from distance with nine minutes remaining, ensuring a late score from the impressive Duncan Taylor was no more than a consolation as Wales claimed a crucial two points after their draw with Ireland last weekend.
An eye-catching finish from Gareth Davies ensured the early dominance of Warren Gatland's side was rewarded.
Roberts and Taylor contested a chip from Dan Biggar, passed fit to start following an ankle injury. The loose ball was then picked up by scrum-half Davies, who demonstrated tremendous pace to race over from 40 metres, with Biggar converting from the left touchline.
Having hardly touched the ball in the first 10 minutes, Scotland made the most of their first meaningful attack, a 21-phase move ending with Finn Russell clipping a delicate kick into the right corner for Tommy Seymour to touch down.
Greig Laidlaw emulated Biggar with a fine conversion, but Stuart Hogg limped off after 29 minutes in a significant blow to the visitors, Ruaridh Jackson - a late addition to the bench when Sean Lamont was called upon to replace the injured Sean Maitland - taking the full-back's place.
By that stage, Scotland were looking the more likely to move ahead and they did so through a Laidlaw penalty after Justin Tipuric had been pulled up for not releasing.
Biggar responded in kind following a strong Welsh scrum, yet another Laidlaw three-pointer rounded off the first half and gave Scotland a deserved 13-10 lead.
The two kickers traded penalties again in the opening 15 minutes of a scrappy second half - Laidlaw's fourth successful attempt coming after his side had won the latest scrum battle.
However, Wales finished much the stronger and their decision to refuse a kickable penalty was justified when Roberts powered over from close range with a trademark bullocking run, soon after Taylor had heroically denied Tom James a try with a superb chase and tackle.
North duly brushed off two missed tackles to cut through Scotland's midfield and make the game safe, with Taylor's 79th-minute reply coming too late in the day for Scotland.