text: Media playback is not supported on this device
  Scottish full-back Stuart Hogg ran in the opening try but Leigh Halfpenny's three penalties and a slick Rhys Webb score put Wales 16-10 up by half-time.
  A disallowed Liam Williams effort and a missed Halfpenny penalty gave Scotland hope that they could recover.
  But Jon Welsh's late try was not enough after Jonathan Davies had powered over.
  Wales are now back on track to mount a championship challenge, but despite the Scots' improvement, they still seem a little short of the Six Nations heavyweights.
  Warren Gatland's side arrived in Edinburgh reeling from that loss to a patchwork England side.
  Scotland also began the tournament with a defeat, to France in Paris, but there was enough in their display to give their fans hope they could beat Wales for the first time in the Gatland era.
  The Scots had spoken of keeping the penalty count down, but they conceded three in the first five minutes, one of which was kicked by Halfpenny to give Wales the lead.
  As the Welsh began to build pressure, they were hit by a breakaway try.
  Alex Cuthbert lost possession and Richie Gray shipped the ball wide to Hogg, who showed great speed to race past the cover defence and score under the posts. Laidlaw's conversion and a subsequent penalty put the Scots 10-3 up before Halfpenny responded with a three-pointer of his own.
  Scotland lost fly-half Finn Russell to the sin-bin on the half-hour when he was judged to have taken out opposite number Dan Biggar with a dangerous tackle in the air. Halfpenny brought the score to 10-9 with the resultant penalty.
  Wales did not take long to make their one-man advantage count, a sweeping move from inside their own half stretching the Scots' defence to breaking point, and scrum-half Webb diving over in the corner.
  Halfpenny added the extras to put Wales 16-10 up at the break.
  Two Laidlaw penalties either side of a successful Halfpenny kick kept the Scots within three early in the second-half.
  Wales had a Liam Williams try ruled out for an off-the-ball infringement by Alun Wyn Jones, but the referee could not save Scotland 15 minutes from the end when Davies scored Wales' second try.
  The British and Irish Lion came on to a Biggar pass at pace and, after powering through some soft midfield tackling, the centre coasted under the posts to leave Halfpenny with the simplest of conversions to give Wales a 10-point lead.
  That looked to have ended the match as a contest, but the Scots refused to buckle, with Mark Bennett and Hogg making searing line breaks.
  They did force a try in the dying seconds when Welsh ploughed over from close range, but it was too late and once again the home side had to be content with the 'gallant losers' tag.
  Scotland: Hogg; Lamont, Bennett, Dunbar, Visser; Russell, Laidlaw; Dickinson, Ford, Cross, R Gray, J Gray, Harley, Cowan, Beattie.
  Replacements: Scott for Dunbar (58), Hidalgo-Clyne for Laidlaw (71), Reid for Dickinson (61), F Brown for Ford (71), Welsh for Cross (50), Hamilton for R Gray (56), Strokosch for Beattie (58).
  Not Used: Tonks.
  Sin Bin: Russell (32).
  Wales: Halfpenny; Cuthbert, J Davies, Roberts, L Williams; Biggar, Webb; Jenkins, Hibbard, Jarvis, Ball, A Jones, Lydiate, Warburton, Faletau.
  Replacements: M. Phillips for Webb (74), James for Jenkins (71), Baldwin for Hibbard (60), Andrews for Jarvis (60), Charteris for Ball (60), Tipuric for Lydiate (61).
  Not Used: Priestland, S Williams.
  Sin Bin: J Davies (37).
  Att: 67,144
  Ref: Glen Jackson (New Zealand).
target: Wales recovered from their opening Six Nations defeat by England to secure a hard-fought win at Murrayfield that leaves Scotland without a point.