Scotland survived an almighty scare to win their first match in Cardiff in over 20 years, running out 27-26 winners.
A young Welsh side found themselves 27-0 down after 42 minutes but came roaring back into the match, scoring four tries to get within a point of their visitors.
They fell agonisingly short of a famous comeback victory but put some respect on a scoreline that threatened to get away from them.
After some early sparring, two Welsh offsides gave Scotland captain Finn Russell and easy shot at goal and he booted his team into the lead after six minutes.
Wales survived a scare moments after the restart but would crack again within minutes.
Some clever misdirection around the halfway line released winger Kyle Steyn up the near touchline. Then the forwards took over and prop Pierre Schoeman burrowed his way over underneath the sticks, leaving a simple conversion for Russell to open up a 10-0 lead.
Welsh indiscipline made things relatively straightforward for their visitors in the opening quarter and Russell extended the lead with another penalty in the 21st minute. This time, the experienced Josh Adams was penalised for throwing the ball away, preventing Scotland from taking a quick lineout.
As the half wore on, Wales offered little and Scotland showed a clinical edge. Kyle Rowe made good yards up the near touchline before a cute pass from Sione Tuipulotu sent Russell through a gaping hole in the Welsh defence. He gave Duhan van der Merwe one of the easier finishes of his career, with the conversion opening up a 20-0 lead.
Wales kicked to the corner after a scrum penalty late in the first half but then lost their third lineout of the game and Scotland cleared their lines, taking a healthy lead in at the break.
Scotland were fast out of the blocks in the second half. With just 42 minutes on the clock, a Russell offload put van der Merwe into open field and he rounded replacement scrum-half Tomos Williams with ease to score his side's third try of the match.
Shortly after, Scottish indiscipline gave Wales good field position and a powerful driving maul charged towards the try line. It was brought down illegally by Scottish hooker George Turner but James Botham still managed to cross the whitewash.
Ioan Lloyd missed the conversion but Turner was sent to the sin bin.
The Welsh set piece made their man advantage count, earning a penalty at the next scrum and maul near the Scotland line. They decided to tap-and-go five metres out, which paid off when a long, looping Tomos Williams pass put Rio Dyer over in the corner.
Lloyd converted from the touchline to chip away at Scotland's lead.
More pressure came piling on from the red jerseys, who were once again gifted field position by Scottish indiscipline and Sione Tuipulotu was next to go to the sin bin after repeated infringements from the visitors.
Wales took the quick tap again from close range and Aaron Wainwright barged his way over near the left-hand post. Lloyd converted and Scotland's lead was down to eight.
Red jerseys refused to back down and a searing break from Dyer gave his side perfect field position. Scotland were penalised once again and, from a five-metre lineout drive, Alex Mann charged over on his international debut.
Lloyd converted expertly and, after trailing 27-0, Wales were within a point of Scotland with just over 10 minutes to go.
But they couldn't find the score that would have completed a famous comeback, and had to settle for two bonus points.
Wales: Cam Winnett; Rio Dyer, Owen Watkin, Nick Tompkins, Josh Adams; Sam Costelow, Gareth Davies; Corey Domachowski, Ryan Elias, Leon Brown; Dafydd Jenkins (C), Adam Beard; James Botham, Tommy Reffell, Aaron Wainwright.
Reps: Elliot Dee, Kemsley Mathias, Keiron Assaratti, Teddy Williams, Alex Mann, Tomos Williams, Ioan Lloyd, Mason Grady.
Scotland: Kyle Rowe; Kyle Steyn, Huw Jones, Sione Tuipulotu, Duhan van der Merwe; Finn Russell (C), Ben White; Pierre Schoeman, George Turner, Zander Fagerson; Richie Gray, Scott Cummings; Luke Crosbie, Jamie Ritchie, Matt Fagerson.
Reps: Ewan Ashman, Alex Hepburn, Elliot Millar-Mills, Sam Skinner, Jack Dempsey, George Horne, Ben Healy, Cameron Redpath.