With the likes of Bagioli, van Gils and Oss between the leading group of 15 riders, pressure was put on as the gap grew to a maximum of 1:30 minutes over the peloton, led by Bahrain, Uno-X, UAE and Arkéa mainly.
The lead at the bottom of the climb though was still of a minute.
Andrea Bagioli attacked early on and took
Maxim van Gils with him, but inside the final kilometer of the climb the Italian cracked and left the Lotto Soudal rider in front alone.
Van Gils went on to power to the line winning the stage whilst Bagioli cracked and got caught and passed by the chasing group led by
Santiago Buitrago and Rui Costa who came from the peloton and caught up with some riders who had been in front during the echelon action.
Luka Mezgec came home second followed by Tim Declercq 40 seconds off, in a group containing the former leader. Buitrago is now 36 seconds behind van Gils in the GC.