Red jersey Chris Froome (Team Sky) gained time on the summit finish of the Alto Hoya de la Mora as Miguel Angel Lopez (Astana) claimed stage victory.
Lopez accelerated away from the GC group, catching and passing Adam Yates (Orica-Scott), who had attacked earlier on the climb, after also distancing Alberto Contador (Trek-Segafredo) too.
Ilnur Zakarin (Katusha-Alpecin) attacked from the GC group to take second place, ahead of Wilco Kelderman (Team Sunweb), jumping above the Dutchman into third overall as a result.
Froome, meanwhile, claimed fifth place – six seconds clear of Vincenzo Nibali (Bahrain-Merida) – to stretch his overall lead back above the minute mark.