Scotland 30-22 Wales
In a game that had been billed as a wooden spoon play-off, Scotland finally found their RBS Six Nations feet to bury Wales with a dominant forward display.
The defeat leaves Steve Hansen's heavily-criticised Wales side facing games against Ireland and France to restore some pride from a miserable campaign.
A powerful performance from Scotland's front five, coupled with dynamic displays from Simon Taylor, James White and Andrew Mower in the back row, was just enough to give the home side the much-needed victory.
The Welsh did rally in the second half - and claimed two consolation tries at the death - but it was a case of too little too late.
Scotland opened the scoring in the fifth minute when wing Chris Paterson slotted over a penalty after an infringement by Welsh prop Ben Evans.
Tries: Douglas, Taylor, Paterson
Cons: Paterson 3
Pens: Paterson 3
Try: Cooper, Taylor, Rhys Williams
Con: Jones 2
Their slender lead took on a more substantial look when Scottish prop Bruce Douglas drove over following good work from the home pack.
Although it is unlikely to feature in many Six Nations highlights packages, Douglas' try was, nonetheless, the first Scotland had managed this year.
Paterson added the extras to make it 10-0 after 15 minutes.
Welsh fly-half Stephen Jones trimmed this lead by three points with a penalty of his own, but this was only temporary respite as Scotland immediately claimed their second try of the season.
We're not going to get carried away because there was still a lot of
Once again it was a forward who crossed the line, this time the impressive Taylor. Paterson converted to make it 17-3 after 20 minutes.
But this sparked the Welsh into life and they scored a wonderful try of their own when scrum-half Gareth Cooper touched down after a flowing passage of play.
Jones converted to make it 17-10, but Paterson knocked over a penalty just before the interval to stretch Scotland's lead to double figures once more.
Paterson kicked his third penalty immediately after the restart to give the hosts a significant 23-10 margin before the game slipped into a 30-minute stalemate.
Wales pushed and probed - creating a number of half chances - but Scotland were able to soak up the pressure without too much difficulty.
The home side's only wobble came when centre James McLaren was sin-binned for a professional foul with 10 minutes remaining.
We just didn't take the opportunities we created for ourselves
Wales, fortified by the arrival of Iestyn Harris from the bench, passed up kickable penalties and poured forward in search of a second try.
But the Scots held out, and Paterson, who was perfect with the boot, capped his day with an opportunist try when Rhys Williams made a mess of a Tom Smith grubber kick.
With the game lost, Wales claimed two injury-time tries through Mark Taylor and Williams.
But these consolation efforts were at least 10 minutes too late to alter the result or save their season.
Scotland: G. Metcalfe, Paterson, McLaren, Utterson, Logan,
Townsend, Redpath, T. Smith, Bulloch, Douglas, Murray, Grimes,
White, Mower, Taylor.
Replacements: Russell, G. Kerr, Hines, Petrie, Blair, G. Ross,
Wales: K. Morgan, R. Williams, Taylor, Shanklin, G. Thomas,
S. Jones, V. Cooper, I. Thomas, G. Williams, Evans, Sidoli,
S. Williams, D. Jones, M. Williams, G. Thomas.
Replacements: M. Davies, Jenkins, Llewellyn, Charvis, Peel,
Referee: Pablo Deluca (Argentina)