Captain Dan Biggar kicked 15 points in his 100th international to guide Wales to victory against Scotland.
Biggar sealed the win with a late drop-goal after opposite number Finn Russell had received a 68th-minute yellow card for a deliberate knock-on.
Scotland wing Darcy Graham and Wales prop Tomas Francis scored tries while Biggar and Russell kicked penalties as the first half ended 14-14.
There were no second-half tries but Biggar's intervention clinched the win.
It proved a captivating contest in Cardiff as Wales bounced back from the disappointment of an opening Six Nations weekend defeat against Ireland.
It was a vastly improved performance from Wayne Pivac's side as they found the physicality missing in the Dublin defeat, typified by hooker Ryan Elias being named man of the match.
The victory was a fitting occasion for Biggar and Jonathan Davies who both celebrated reaching the milestone of 100 internationals.
In contrast Scotland celebrated a Calcutta Cup victory against England last weekend, but their 20-year record of not winning in Cardiff goes on.
Gregor Townsend's side won away at Twickenham and Stade de France last season, but those stadiums were empty, unlike the raucous reception they received at the home of Welsh rugby.
Stuart Hogg's men also enjoyed success in Llanelli in October 2020 but that was also in front of an empty stadium after the match had been postponed in March that year because of Covid-19.
That major victory on the road in front of a capacity crowd remains elusive.
Fresh faces make difference
Wales coach Pivac got his tactics and changes right as he gave a debut to Ospreys flanker Jac Morgan while Ross Moriarty was also recalled in the back row alongside Taine Basham.
Centre Owen Watkin replaced the injured Josh Adams, while wing Alex Cuthbert made a first Six Nations appearance in five years in place of Johnny McNicholl on the wing.
Scotland made five changes, with injured flanker Jamie Ritchie ruled out for the tournament and replaced by Exeter forward Sam Skinner.
The front row swapped completely, with Pierre Schoeman, Stuart McInally and WP Nel starting, while centre Sione Tuipulotu was also selected.
Lock Grant Gilchrist led the side out on his 50th cap and it was Matt Fagerson who led an early charge for Scotland.
Full-back Liam Williams turned the ball over and released Watkin, Biggar and Tomos Williams for an incisive counter-attack.
It was only halted when Scotland captain Hogg knocked the ball forward. Australia referee Nic Berry decided it was not deliberate, which could have resulted in a yellow card for the visiting full-back.
Scotland were penalised at the ensuing scrum with Biggar slotting over the penalty and soon doubled the lead.
Lions wing Duhan van der Merwe launched the attack for the Scotland riposte with Graham reaping the benefit on the opposite wing after being the beneficiary of a long Russell pass.
Graham produced a superb finish in the right corner after shrugging off the attempted tackle of Louis Rees-Zammit.
Russell missed the conversion, but slotted over two penalties with the hosts punished for the kind of indiscipline that was also seen in Dublin.
Wales retaliated with a sustained attack that culminated in a third Biggar penalty before Russell responded with three points after outstanding breakdown work from Hamish Watson.
A searching 50:22 attacking kick from Liam Williams provided the platform for prop Francis to eventually burrow over to leave the half-time score at 14-14.
Scotland, who were also warned for their ill-discipline, lost Fagerson to injury with Magnus Bradbury replacing the number eight.
Honours even
The visitors brought on a new front row of George Turner, Rory Sutherland and Zander Fagerson as the second half started in cagey fashion.
Russell broke the impasse with a penalty after Wales transgressed at a ruck.
Williams provided an impudent flick pass in his 22 before Biggar, who was battling on with a leg injury, levelled the scores with his fourth penalty.
In a raft of replacements, Aaron Wainwright and Dillon Lewis replaced Moriarty and Francis, while Scotland flanker Rory Darge made his debut from the bench.
Wales scrum-half Williams was becoming increasingly influential with his sniping breaks, before drama ensued after a Biggar penalty attempt.
The ball hit the bar and was gathered by Cuthbert before the wing almost scored in the left-hand corner.
That was ruled out after the Wales wing was bundled into touch before scoring, but Russell was shown a yellow card for a deliberate knock-on earlier in the move.
Centre Jonathan Davies received a huge roar as he entered the field for his 100th international when he came on as a replacement for Nick Tompkins.
Biggar then nudged Wales ahead with a drop-goal as he ignored a penalty advantage and the prospect of going for a try to claim the three points.
It proved the right decision. A frantic finale saw Taine Basham give away a late penalty for a high tackle but the flanker avoided any further sanction.
Scotland were forced to chase victory from their own line but Wales' dogged defence stood firm.
Wales: L. Williams; Cuthbert, Watkin, Tompkins (J Davies, 69), Rees-Zammit; Biggar (capt; Sheedy, 79), T. Williams; W. Jones (G Thomas, 65), Elias (Lake, 65), Francis (Lewis, 59), Rowlands (S Davies, 75), Beard, Basham, Morgan, Moriarty (Wainwright, 57).
Replacements: Lake, G. Thomas, Lewis, S. Davies, Wainwright, G. Davies, Sheedy, J. Davies
Scotland: Hogg (capt); Graham, Harris, Tuipulotu, Van der Merwe (Redpath, 79); Russell, Price (White, 62); Schoeman (Turner, 44), McInally (Sutherland, 44), Nel (Z. Fagerson, 44), Gray (Darge, 62), Gilchrist, Skinner, Watson, M. Fagerson (Bradbury, 31)
Replacements: Turner, Sutherland, Z. Fagerson, Bradbury, Darge, White, Kinghorn, Redpath
Referee: Nic Berry (Australia)
Touch judges: Wayne Barnes (England) & Chris Busby (Ireland)
TMO: Brett Cronan (Australia)