Scotland's two decade winless run in Cardiff continues after another defeat in Wales took the wind from the sails of our Six Nations campaign.
A late Dan Biggar drop goal was enough to edge the contest 20-17 for the Dragons despite the Dark Blues leading through Darcy Graham's first-half try.
After the euphoria of last weekend's Calcutta Cup win over England, the come-down arrived at a packed Principality Stadium which saw playmaker Finn Russell sin-binned in the crucial closing stages.
Now all eyes turn to a meeting with France at Murrayfield in a fortnight's time in a bid to salvage a way back into the Championship reckoning.
A confident Scottish start had the Welsh under pressure during an electrifying opening but it was the Welsh who made the first break with Owen Watkin threatening to burst clear only to be brought to the deck.
It was advantage Wales in the fourth minute as the visitors collapsed a scrum and Biggar fired a penalty between the posts to put first points on the board.
Three points became six for the Welsh moments later as Scotland were again penalised for indiscipline and another Biggar penalty edged the hosts further ahead.
Scotland's reply was instant and typically sensational as Russell's superb long throw wide allowed Darcy Graham to dive into the corner for the try but Russell's conversion attempt was fired wide but it was Townsend's side at their most scintillating.
The recovery was complete with just minutes on the clock as Russell made no mistake by arrowing a penalty on target and it was 8-6 to a Scottish side refusing to buckle from the physical approach by the wounded Dragons in front of their home crowd.
Another routine Russell penalty pushed Scotland 11-6 ahead with Wales being punished yet again for a lack of discipline at the breakdown.
Then it was the Welsh who had a turn at exerting some sustained pressure of their own and it led to Biggar blasting over another penalty to squeeze the score to just two points.
Penalties continued to be traded in short order and Russell's 28th minute three pointer restored Scotland's five point lead.
Wales then started to get their hands on the ball as the half drew to a close and it came with a try of their own as Tomas Francis bulldozed his way over from a driving maul and the score was tied after Bigger failed to add the extras.
A display of relentless attacking enterprise from both teams was brought to a close with nothing to separate them, clearly the afternoon would be one of nervous tension and anxiety in a contest going down to the wire.
The frenzied intensity of the first half dipped at the restart with conservative kicking being deployed but Scotland were gaining territory slowly but surely as the half progressed as Gregor Townsend made wholesale changes in the front-row to add more physical edge to his side. It paid dividends in the 50th minute as Russell bagged another penalty to edge Scotland three points ahead.
Basic errors continued to be the undoing of the Welsh who finally sparked into life in the 56th minute as Louis Rees-Zammit only just failed to touch down in the corner before Biggar levelled the game with a penalty on the hour mark.
Then a potential nightmare moment arrived and it was a two of horrible misfortune for Biggar's long-range penalty to bounce off the woodwork and into Welsh hands as Alex Cutbert was inches away from scoring in the corner and it required a TMO to get Scotland off the hook.
Russell's deliberate knock-out saw him yellow carded and Townsend's men were a man down going into the final ten minutes.
It proved a decisive turning point as Biggar's drop-goal put Wales into a three point lead. It was all looking ominous for a tiring Scottish side and so it was to prove as Wales saw out their win to lift the Doddie Weir Cup.