Blair Kinghorn scored three tries as Scotland rounded off their Six Nations campaign with a 26-14 bonus-point win over Italy to all but seal third place in this year's championship.
Gregor Townsend's side had lost successive games to France and Ireland, having opened up with back-to-back wins for the first time, but they ended their tournament on a high.
Duhan van der Merwe and Kinghorn crossed over in the first half, though Scotland's advantage stood at just six points at the interval as Tommaso Allan twice kicked over.
Kinghorn marked his return to the side with another try early in the second half and, while Allan did reduce the deficit to five points, Kinghorn's late third snatched a bonus point.
Van der Merwe brilliantly grounded the ball in the left corner mid-leap to get Scotland off the mark, but a couple of Allan penalties either side ensured Italy had the lead.
Marco Riccioni was shown a yellow card after another collapsed scrum and that proved a big moment as Kinghorn crashed over a minute later and this time converted.
Despite some last-ditch defending, Ben White was able to spin the ball to Kinghorn to stretch over in the 43rd minute for another converted try as Scotland moved well in front.
However, Allan collected Paolo Garbisi's grubber to open Italy's try count and, having missed the conversion, found the sticks from a penalty to bring Scotland within five points.
That set up a gripping conclusion, but Italy's hopes of snatching a second win in 42 Six Nations games ended when Van der Merwe played in star man Kinghorn on the counter.
Scotland get the job done
Despite what the scoreline may suggest, this was a far from vintage performance from Scotland and it could so easily have been Italy who came away with the victory.
Townsend's side ultimately came out on top, though, with this their eighth successive Six Nations win against Italy, who finish with the wooden spoon for an eighth time running.
Scotland now look certain to finish third for the first time since 2018, bar an improbable big margin of victory for England in their showdown with Grand Slam-chasing Ireland later on Saturday.
Kinghorn does it again
This was the first game Scotland had started without either Finn Russell or Stuart Hogg in their side since the opening game of the 2012 edition.
Ollie Smith and Kinghorn were brought in, and boy did the latter make the most of the chance, with his hat-trick taking him level with team-mate Huw Jones at the top of the tournament try chart.
It is the second time Kinghorn has scored two or more tries in a single game for Scotland, the other occasion also coming against Italy on the opening day of the 2019 tournament when also scoring a hat-trick.