The footage from Gaviria's Go Pro in the Velon video below shows you just how close Walscheid came, but the win was Gaviria's nonetheless.
It was QuickStep Floor's 55th victory this season, its best since 2014.
"Can’t say I had the best sensations in my legs this morning," Gaviria said "But things became better as the stage progressed. Having all the guys around, protecting me in every moment, helped a lot today."
"Martin (Velits) and Pieter (Serry) worked hard and pulled back the break, while Max (Richeze) provided another solid proof lead-out in the final 500 metres."
"I love this team, it’s my second family and I’m really proud to be part of the Wolfpack and live so many great moments with them."
Attacks came thick and early on the four laps of the 31.4km circuit, a break of Jack Haig (Orica-Scott), Daniel Oss (BMC) and Nuno Bico (Movistar) built an advantage of two minutes after 25 kilometres of racing.
The trio were caught with 55 kilometres to go and despite another flurry of attacks, no other move stuck before the bunch sprint to the finish.