A tyre's width and a better bike throw was all that separated Gaviria and Wahlscheid in the final reckoning of what was a fascinating final sprint in the Tour of California.
QuickStep Floors looked to have stolen a march on their opposition with a leadout that gapped the rest of the field, but a surge from Mitchelton-Scott and Ewan had the Australian edging ahead of his Colombian rival.
Gaviria retook the lead as he got up to full speed, but a fast-finishing Wahlscheid slipped between the battling pair and looked to have taken the win as he saluted to the Sacramento crowd.
Photo evidence showed that Gaviria had in fact just got his wheel to the line ahead of Wahlscheid, who threw his bike just a few metres after the finish.
The early break was made up of Neilson Powless (LottoNL-Jumbo), Adam De Vos (Rally), Mikkel Bjerg (Hagens Berman Axeon) and Australian Jonathan Clarke (UnitedHealthcare). The peloton allowed them to get off the front of the race, but kept their advantage well in hand and never permitted the four riders an advantage of much more than two minutes.
On the wide open roads around the countryside surrounding Sacramento the teams of the sprinters continued to reel back the escapees and with four kilometres to go the race was all back together and headed for a bunch sprint.
The day was uneventful on the general classification with the podium of Egan Bernal (Team Sky), Tejay van Garderen (BMC) and Daniel Martinez (Education First EF-Drapac) retaining their positions from the previous stage.