Wales’ record try-scorer struck in each half while James Hook added 14-points with the boot as Wales got back to winning ways with a hard-fought triumph in the Scottish capital.
Warren Gatland’s men came out firing and it took them just seven minutes to open the scoring with Williams sliding over.
Wales had trailed 24-14 at the end of normal play at the Millennium Stadium last year. But they scored 17- unanswered points in seven minutes of injury time with Williams grabbing the final touch down to seal the most astonishing comeback in Six Nations history.
And Williams was at it again after Wales turned a Scottish scrum against the head. After several phases Hook ghosted past Allan Jacobsen and John Barclay before sending Williams over. Hook took the extras and added a penalty five minutes later. He added three more penalties before Scotland fought their way back in to the game.
Bradley Davies was sent to the sin bin after infringing at the ruck and four minutes later Lee Byrne was shown yellow for a high tackle.
But spirited Wales held on and only conceded three points from the boot of Cardiff Blues fly-half Dan Parks while they were down to 13 men.
Scotland came out fighting in the second half and Parks added a second penalty on 58 minutes.
Jamie Roberts almost put the result beyond doubt shortly after the hour mark. The powerhouse sliced through Scotland’s defence but Sean Lamont hauled him down agonisingly short of the line. But Wales were rewarded with a penalty which Hook duly converted.
And Williams capped a fine team performance with a late try after Jon Davies chipped over the Scottish defence.
Scorers:
Scotland: Pens – Parks (2);
Wales: Tries – Williams (2); Con – Hook; Pen – Hook (4)
Attendance : 60, 259