With Lidl-Trek attempting to control the peloton for Mattias Skjelmose, their plans were disrupted early as William Junior Lecerf and Marc Soler attacked from the main group with over 70km still to go, with Soler soon dropping the young Soudal - Quick-Step talent.
On the third climb of the day, things thinned out at the front, with the more renowned climbers such as Kuss, Onley and Chaves coming to the fore.
With just over 40km to go, Soler made contact with the head of the race and it was advantage
UAE Team Emirates with the peloton over a minute behind and Skjelmose down to just one rider left in his service, Tao Geoghegan Hart.
As the break began to split up on the penultimate climb, Onley was proving the strongest, dropping the likes of Kuss, Soler and Chaves. Meanwhile, Skjelmose finally took matters into his own hands, although the Dane was countered by Carlos Rodriguez and Juan Ayuso.
Ayuso bridged across to Soler, Chaves and Steven Kruijswijk, putting Soler to work in chasing down Onley and attempting to gap Skjelmose. Incredibly, on the descent though, it came back together at the front as Skjelmose made contact courtesy of some very impressive riding.
As soon as the last climb began though, Ayuso shot off up the road with only Rodriguez able to follow the UAE Team Emirates leader.
With the Spanish duo working well together, they soon began to extend their advantage over the chasers to up over half a minute.
Heading into the final few kilometres, that lead was up over 40 seconds and overall victory was secured for Ayuso, with him gifting the stage win to Rodriguez.